5 stable releases

1.1.0 Jul 1, 2021
1.0.3 Jul 17, 2018

#48 in Value formatting

Download history 20971/week @ 2024-03-14 22051/week @ 2024-03-21 21359/week @ 2024-03-28 22484/week @ 2024-04-04 21882/week @ 2024-04-11 22461/week @ 2024-04-18 21309/week @ 2024-04-25 21631/week @ 2024-05-02 18520/week @ 2024-05-09 15547/week @ 2024-05-16 14907/week @ 2024-05-23 17401/week @ 2024-05-30 13592/week @ 2024-06-06 14474/week @ 2024-06-13 14035/week @ 2024-06-20 11856/week @ 2024-06-27

56,917 downloads per month
Used in 57 crates (24 directly)

Unlicense

7KB
105 lines

enquote crate docs

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

~290–750KB
~18K SLoC