6 个版本
0.3.1 | 2021 年 12 月 29 日 |
---|---|
0.3.0 | 2021 年 12 月 29 日 |
0.2.0 | 2021 年 12 月 27 日 |
0.1.2 | 2021 年 12 月 26 日 |
#4 in #friend
17KB
283 行代码(不含注释)
text_align
use text_align::TextAlign;
fn main() {
assert_eq!(
" Hello my dearest friend!".left_align(50),
"Hello my dearest friend! "
);
assert_eq!(
"Hello my dearest friend!".right_align(50),
" Hello my dearest friend!"
);
assert_eq!(
"Hello my dearest friend!".center_align(50),
" Hello my dearest friend! "
);
assert_eq!(
"Hello my dearest friend!".justify(50),
"Hello my dearest friend!"
);
assert_eq!(
"Hello my dearest friend!".dejustify(2),
"Hello my dearest friend!"
);
}
lib.rs
:
use text_align::TextAlign;
assert_eq!(
" Hello my dearest friend!".left_align(50),
"Hello my dearest friend! "
);
assert_eq!(
"Hello my dearest friend!".right_align(50),
" Hello my dearest friend!"
);
assert_eq!(
"Hello my dearest friend!".center_align(50),
" Hello my dearest friend! "
);
assert_eq!(
"Hello my dearest friend!".justify(50),
"Hello my dearest friend!"
);
assert_eq!(
"Hello my dearest friend!".dejustify(2),
"Hello my dearest friend!"
);
依赖
~2.2–3MB
~53K 额外代码行数(SLoC)