Rollup merge of #69637 - matthiaskrgr:if_let_some_result, r=ecstatic-morse
Don't convert Results to Options just for matching.
This commit is contained in:
commit
e453a0cc49
2 changed files with 3 additions and 3 deletions
|
@ -1252,7 +1252,7 @@ impl<'a, 'b> ImportResolver<'a, 'b> {
|
|||
// this may resolve to either a value or a type, but for documentation
|
||||
// purposes it's good enough to just favor one over the other.
|
||||
self.r.per_ns(|this, ns| {
|
||||
if let Some(binding) = source_bindings[ns].get().ok() {
|
||||
if let Ok(binding) = source_bindings[ns].get() {
|
||||
this.import_res_map.entry(directive.id).or_default()[ns] = Some(binding.res());
|
||||
}
|
||||
});
|
||||
|
@ -1293,7 +1293,7 @@ impl<'a, 'b> ImportResolver<'a, 'b> {
|
|||
let mut redundant_span = PerNS { value_ns: None, type_ns: None, macro_ns: None };
|
||||
|
||||
self.r.per_ns(|this, ns| {
|
||||
if let Some(binding) = source_bindings[ns].get().ok() {
|
||||
if let Ok(binding) = source_bindings[ns].get() {
|
||||
if binding.res() == Res::Err {
|
||||
return;
|
||||
}
|
||||
|
|
|
@ -901,7 +901,7 @@ impl ToSocketAddrs for str {
|
|||
type Iter = vec::IntoIter<SocketAddr>;
|
||||
fn to_socket_addrs(&self) -> io::Result<vec::IntoIter<SocketAddr>> {
|
||||
// try to parse as a regular SocketAddr first
|
||||
if let Some(addr) = self.parse().ok() {
|
||||
if let Ok(addr) = self.parse() {
|
||||
return Ok(vec![addr].into_iter());
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue