5 stable releases
1.1.0 | Jul 1, 2021 |
---|---|
1.0.3 | Jul 17, 2018 |
#37 in Value formatting
72,071 downloads per month
Used in 59 crates
(24 directly)
7KB
105 lines
enquote
This Rust library quotes, unquotes, and unescapes strings.
Example
extern crate enquote;
fn main() {
assert_eq!(enquote::enquote('\'', "foo'bar"), "'foo\\'bar'");
assert_eq!(enquote::unquote("'foo\\'bar\\n'").unwrap(), "foo'bar\n");
assert_eq!(enquote::unescape("\\n", None).unwrap(), "\n");
}
lib.rs
:
This Rust library quotes, unquotes, and unescapes strings.
Examples
extern crate enquote;
fn main() {
assert_eq!(enquote::enquote('\'', "foo'bar"), "'foo\\'bar'");
assert_eq!(enquote::unquote("'foo\\'bar\\n'").unwrap(), "foo'bar\n");
assert_eq!(enquote::unescape("\\n", None).unwrap(), "\n");
}
Dependencies
~250–710KB
~17K SLoC