Expand description
A small library with some convenient string helpers.
use lngh_strings::{WriteStringExt,WriteLnStringExt,WriteDebugStringExt,WriteLnDebugStringExt};
let pink = (255, 27, 141);
let yellow = (255, 218, 0);
let blue = (27, 179, 255);
let mut string = String::new();
string.writeln("hello world!")
.writeln("The pan flag's colours are (in rgb):")
.write("pink: ").writeln_debug(pink)
.write("yellow: ").writeln_debug(yellow)
.write("blue: ").write_debug(blue);
let expected =
r#"hello world!
The pan flag's colours are (in rgb):
pink: (255, 27, 141)
yellow: (255, 218, 0)
blue: (27, 179, 255)"#;
assert_eq!(expected, string);Traits§
- Write
Debug String Ext - This an extension trait specifically for appending items with the Debug trait to strings conveniently.
- Write
LnDebug String Ext - This an extension trait specifically for appending items with the Debug trait and a newline to strings conveniently.
- Write
LnString Ext - This an extension trait specifically for appending to strings conveniently.
- Write
String Ext - This an extension trait specifically for appending &str’s to strings conveniently.