5个稳定版本

1.1.0 2021年7月1日
1.0.3 2018年7月17日

#48值格式化

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 每月下载量
用于 57 个crates (24直接)

无许可证

7KB
105

enquote crate docs

这个Rust库对字符串进行引号、取消引号和转义。

示例

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:

这个Rust库对字符串进行引号、取消引号和转义。

示例

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");
}

依赖项

~290–750KB
~18K SLoC