mirror of
https://github.com/fawney19/Aether.git
synced 2026-09-03 01:40:21 +08:00
8 lines
211 B
Rust
8 lines
211 B
Rust
|
|
pub(crate) fn non_empty_owned(value: Option<&String>) -> Option<String> {
|
||
|
|
value
|
||
|
|
.map(String::as_str)
|
||
|
|
.map(str::trim)
|
||
|
|
.filter(|value| !value.is_empty())
|
||
|
|
.map(str::to_string)
|
||
|
|
}
|