cli: add an input subcommand
This commit is contained in:
parent
283e438d1b
commit
efae1cd16a
19 changed files with 1383 additions and 36 deletions
11
src/utils/string_ext.rs
Normal file
11
src/utils/string_ext.rs
Normal 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())
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue