mirror of
https://github.com/chatmail/core.git
synced 2026-04-29 11:26:29 +03:00
Simplify unset_empty()
This commit is contained in:
@@ -1,6 +1,5 @@
|
||||
//! # Login parameters.
|
||||
|
||||
use std::borrow::Cow;
|
||||
use std::fmt;
|
||||
|
||||
use anyhow::{ensure, Result};
|
||||
@@ -298,12 +297,11 @@ impl fmt::Display for LoginParam {
|
||||
}
|
||||
}
|
||||
|
||||
#[allow(clippy::ptr_arg)]
|
||||
fn unset_empty(s: &String) -> Cow<String> {
|
||||
fn unset_empty(s: &str) -> &str {
|
||||
if s.is_empty() {
|
||||
Cow::Owned("unset".to_string())
|
||||
"unset"
|
||||
} else {
|
||||
Cow::Borrowed(s)
|
||||
s
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user