3个稳定版本

1.0.2 2019年6月26日

1898Rust模式

Download history · Rust 包仓库 1205/week @ 2024-03-14 · Rust 包仓库 1416/week @ 2024-03-21 · Rust 包仓库 1281/week @ 2024-03-28 · Rust 包仓库 1296/week @ 2024-04-04 · Rust 包仓库 1041/week @ 2024-04-11 · Rust 包仓库 972/week @ 2024-04-18 · Rust 包仓库 891/week @ 2024-04-25 · Rust 包仓库 658/week @ 2024-05-02 · Rust 包仓库 539/week @ 2024-05-09 · Rust 包仓库 694/week @ 2024-05-16 · Rust 包仓库 529/week @ 2024-05-23 · Rust 包仓库 543/week @ 2024-05-30 · Rust 包仓库 518/week @ 2024-06-06 · Rust 包仓库 583/week @ 2024-06-13 · Rust 包仓库 687/week @ 2024-06-20 · Rust 包仓库 567/week @ 2024-06-27 · Rust 包仓库

每月下载 2,419
6 个crate 中使用

MIT/Apache-2.0/CC0-1.0

4KB

Big S — Rust缺失的String字面量

嘿。有时候我们需要一个String,但我们只有字符串字面量(一个&'static str)。我的意思是,我想我们所有人都看到过满是"this".to_string()"that".to_owned(),或者String::from("theother")的令人眼花缭乱的代码。

OMG,有人来做点关于它的事情。

介绍S,这是Rust最愚蠢的“划痕”的三个字符解决方案。

看看这里

do_something_lame("this".to_string(), "that".to_string(), "theother".to_string());

🙄

use big_s::S;

do_something_rad(S("this"), S("that"), S("theother"));

👍

许可协议

MIT/Apache-2.0/CC0-1.0


lib.rs:

Big S — Rust缺失的String字面量

嘿。有时候我们需要一个String,但我们只有字符串字面量(一个&'static str)。我的意思是,我想我们所有人都看到过满是"this".to_string()"that".to_owned(),或者String::from("theother")的令人眼花缭乱的代码。

OMG,有人来做点关于它的事情。

介绍S,这是Rust最愚蠢的“划痕”的三个字符解决方案。

看看这里

do_something_lame("this".to_string(), "that".to_string(), "theother".to_string());

🙄

use big_s::S;

// RADICAL!
do_something_rad(S("this"), S("that"), S("theother"));

👍

无运行时依赖