Module powerletters
Concise single-letter methods for common operations.
- Crate
::powerletters. - docs.rs
- crates.io
- GitHub
powerletters provides single-letter methods for common Rust operations,
offering concise alternatives to standard trait methods.
The crate defines extension traits that add methods like C for cloning,
O for converting to owned types, S for converting to strings,
I for ignoring results, and X for expecting values.
These methods can be used both as method calls on values and as standalone functions, providing flexibility in different coding contexts.
Examples
Cloning with C:
use *;
let vec = vec!;
let cloned = vec.C;
assert_eq!;
Converting to string with S:
use *;
let num = 42;
let s = num.S;
assert_eq!;
Ignoring a result with I:
use *;
use Write;
let mut vec = Vecnew;
write!.I;
Traits
-
PowerClone
Power
Clone. -
PowerExpect
Power
expectforResultandOption. -
PowerToOwned
Power
ToOwned. -
PowerToString
Power
ToString. -
ResultIgnore
Power ignore
Result- kick thatResultto the curb!