rescue-blanket

Crates.iorescue-blanket
lib.rsrescue-blanket
version0.2.0
sourcesrc
created_at2022-02-02 19:34:23.40856
updated_at2022-02-26 12:16:44.651076
descriptionEscape values while they are being formatted
homepage
repository
max_upload_size
id525831
size12,359
maintainers (github:ngyn-rs:maintainers)

documentation

README

rescue-blanket -- escape values while they are being formatted

This crate provides Escaped, a wrapper for escaping special characters and constructs in values while formatting them, and Escaper, a trait for defining escaping logic. In addition, it provides Escapable, an augmentation trait for facilitating wrapping values in Escaped.

The wrapping approach allows escaping arbitrary values implementing Display without the need to buffer them.

Example

use rescue_blanket::Escapable;
println!("foo=\"{}\"", "bar=\"baz\"".escaped_with(char::escape_default));

License

This work is provided under the MIT license. See LICENSE for more details.

Commit count: 0

cargo fmt