5 stable releases
1.1.0 | Jul 1, 2021 |
---|---|
1.0.3 | Jul 17, 2018 |
#36 in Value formatting
76,489 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
~260–720KB
~17K SLoC