mirror of
https://github.com/arampoire/nut-rs.git
synced 2025-12-01 00:30:23 -05:00
Fix clippy error
This commit is contained in:
parent
f3d9195bc4
commit
2fd8ffd170
1 changed files with 5 additions and 7 deletions
|
|
@ -49,15 +49,13 @@ impl<'a> TryFrom<&'a str> for UpsdName<'a> {
|
||||||
} else {
|
} else {
|
||||||
hostname = prefix;
|
hostname = prefix;
|
||||||
}
|
}
|
||||||
} else {
|
} else if value.contains('@') {
|
||||||
if value.contains('@') {
|
|
||||||
let mut split = value.splitn(2, '@');
|
let mut split = value.splitn(2, '@');
|
||||||
upsname = Some(split.next().unwrap());
|
upsname = Some(split.next().unwrap());
|
||||||
hostname = split.next().unwrap();
|
hostname = split.next().unwrap();
|
||||||
} else {
|
} else {
|
||||||
upsname = Some(value);
|
upsname = Some(value);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
Ok(UpsdName {
|
Ok(UpsdName {
|
||||||
upsname,
|
upsname,
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue