Crates.io | uniquote |
lib.rs | uniquote |
version | 4.0.0 |
source | src |
created_at | 2020-05-23 15:00:28.788285 |
updated_at | 2024-02-17 20:35:19.64891 |
description | Quote strings for clear display in output |
homepage | |
repository | https://github.com/dylni/uniquote |
max_upload_size | |
id | 244898 |
size | 48,626 |
This crate allows quoting strings for use in output. It works similarly to
str::escape_debug
, but the result is meant to be shown to users. Simply
call Quote::quote
on an argument passed to println!
or a similar macro
to quote it.
One of the primary uses for this crate is displaying paths losslessly. Since
Path
has no Display
implementation, it is usually output by calling
Path::display
or Path::to_string_lossy
beforehand. However, both of
those methods are lossy; they replace all invalid characters with
REPLACEMENT_CHARACTER
. This crate escapes those invalid characters instead,
allowing them to always be displayed correctly.
Add the following lines to your "Cargo.toml" file:
[dependencies]
uniquote = "4.0"
See the documentation for available functionality and examples.
The minimum supported Rust toolchain version is currently Rust 1.64.0.
Minor version updates may increase this version requirement. However, the previous two Rust releases will always be supported. If the minimum Rust version must not be increased, use a tilde requirement to prevent updating this crate's minor version:
[dependencies]
uniquote = "~4.0"
Licensing terms are specified in COPYRIGHT.
Unless you explicitly state otherwise, any contribution submitted for inclusion in this crate, as defined in LICENSE-APACHE, shall be licensed according to COPYRIGHT, without any additional terms or conditions.
This crate includes copies and modifications of content developed by third parties:
See that file for more details.
Copies of third-party licenses can be found in LICENSE-THIRD-PARTY.