switchstring

Crates.ioswitchstring
lib.rsswitchstring
version0.1.1
sourcesrc
created_at2021-05-28 12:17:21.549193
updated_at2021-05-28 12:34:51.242917
descriptionsubtractable strings
homepagehttps://github.com/lf-/switchstring
repositoryhttps://github.com/lf-/switchstring
max_upload_size
id403091
size12,295
Jade Lovelace (lf-)

documentation

https://docs.rs/switchstring

README

switchstring

it's a string, but unlike a string where you can add substrings, you can subtract substrings here as well. it is thus a switchstring

why

to make mathematicians (and maybe you) suffer of the knowledge that this exists

how

use switchstring::Switchstring;

let a = "I promise I love maths";
let b = "maths";
let c = "cute rustaceans such as ferris";
let d: Switchstring = "I promise ".into();
let improved = String::from(-d + a - b + c);
assert_eq!("I love cute rustaceans such as ferris", improved);
Commit count: 10

cargo fmt