Crates.io | shorten |
lib.rs | shorten |
version | 0.2.0 |
source | src |
created_at | 2018-02-17 16:40:45.790541 |
updated_at | 2021-08-02 11:18:28.922966 |
description | A collection of convenience functions, macros and traits to shorten repetitive code. |
homepage | https://github.com/kkayal/shorten |
repository | https://github.com/kkayal/shorten |
max_upload_size | |
id | 51605 |
size | 4,827 |
A collection of convenience functions, macros and traits to shorten repetitive code.
passively-maintained
0.2
Shorten the conversion to a String.
s!("Hello")
is the same as String::from("Hello"))
Concatenate two string(s) (slices) and return a string slice.
ss!("Hello", ", world")
is the same as "Hello, world";
The same macro works also with an arbitrary combination of String objects and string slices
#[macro_use] extern crate shorten;
use shorten::*;
let s1 = s!("Hello");
let s2 = s!(", world");
assert_eq!(ss!(s1, s2), "Hello, world");
// #[macro_use] extern crate shorten;
#[macro_use] extern crate shorten;
use shorten::*;
let s1 = s!("Hello");
let s2 = s!(", world");
assert_eq!(ss!(s1, s2), "Hello, world");