mirror of
https://github.com/rust-lang/cargo
synced 2024-10-01 21:43:45 +00:00
Remove let-else, just use ? propagation.
Co-authored-by: Weihang Lo <weihanglo@users.noreply.github.com>
This commit is contained in:
parent
302a543ddf
commit
cf716fc3c2
|
@ -478,10 +478,9 @@ fn parse_known_hosts_line(line: &str, location: KnownHostLocation) -> Option<Kno
|
|||
return None;
|
||||
}
|
||||
let mut parts = line.split([' ', '\t']).filter(|s| !s.is_empty());
|
||||
let Some(patterns) = parts.next() else { return None };
|
||||
let Some(key_type) = parts.next() else { return None };
|
||||
let Some(key) = parts.next() else { return None };
|
||||
let Ok(key) = base64::decode(key) else { return None };
|
||||
let patterns = parts.next()?;
|
||||
let key_type = parts.next()?;
|
||||
let key = parts.next().map(base64::decode)?.ok()?;
|
||||
Some(KnownHost {
|
||||
location,
|
||||
patterns: patterns.to_string(),
|
||||
|
|
Loading…
Reference in a new issue