#path #quote #print #osstr #no-alloc #unprintable

no-std uniquote

Quote strings for clear display in output

11 stable releases (4 major)

4.0.0 Feb 17, 2024
3.3.0 Feb 11, 2023
3.2.1 Oct 15, 2022
3.2.0 Jul 17, 2022
0.1.1 May 23, 2020

#56 in Value formatting

Download history 14/week @ 2023-12-22 3/week @ 2023-12-29 4/week @ 2024-01-05 8/week @ 2024-01-12 7/week @ 2024-01-19 4/week @ 2024-01-26 3/week @ 2024-02-02 17/week @ 2024-02-09 229/week @ 2024-02-16 98/week @ 2024-02-23 55/week @ 2024-03-01 43/week @ 2024-03-08 70/week @ 2024-03-15 19/week @ 2024-03-22 51/week @ 2024-03-29 16/week @ 2024-04-05

161 downloads per month
Used in normpath

(MIT OR Apache-2.0) AND Unicode-DFS-2016

35KB
549 lines

UniQuote

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.

GitHub Build Status

Usage

Add the following lines to your "Cargo.toml" file:

[dependencies]
uniquote = "4.0"

See the documentation for available functionality and examples.

Rust version support

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"

License

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.

Third-party content

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.

No runtime deps

Features