1
0
Fork 0
forked from wry/wry

cli: add an input subcommand

This commit is contained in:
Julian Orth 2024-03-12 17:43:26 +01:00
parent 283e438d1b
commit efae1cd16a
19 changed files with 1383 additions and 36 deletions

11
src/utils/string_ext.rs Normal file
View file

@ -0,0 +1,11 @@
use isnt::std_1::primitive::IsntStrExt;
pub trait StringExt {
fn to_string_if_not_empty(&self) -> Option<String>;
}
impl StringExt for str {
fn to_string_if_not_empty(&self) -> Option<String> {
self.is_not_empty().then(|| self.to_string())
}
}