diff options
| author | Michael Goulet <michael@errs.io> | 2023-11-25 17:17:25 +0000 |
|---|---|---|
| committer | Michael Goulet <michael@errs.io> | 2023-11-25 17:18:33 +0000 |
| commit | 63b2f55e83c7fc513eb049746fc4658848b47a4e (patch) | |
| tree | 440372f3e7215ab5aef5032e00a0588d37c1901a /src/librustdoc/html/render | |
| parent | fe3038f263349190f02491d7467198e17ffb0858 (diff) | |
| download | rust-63b2f55e83c7fc513eb049746fc4658848b47a4e.tar.gz rust-63b2f55e83c7fc513eb049746fc4658848b47a4e.zip | |
is_{some,ok}_and for rustdoc
Diffstat (limited to 'src/librustdoc/html/render')
| -rw-r--r-- | src/librustdoc/html/render/mod.rs | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/src/librustdoc/html/render/mod.rs b/src/librustdoc/html/render/mod.rs index 8b3cd9ca6fc..ff5c761208b 100644 --- a/src/librustdoc/html/render/mod.rs +++ b/src/librustdoc/html/render/mod.rs @@ -1381,8 +1381,7 @@ pub(crate) fn notable_traits_button(ty: &clean::Type, cx: &mut Context<'_>) -> O if let Some(trait_) = &impl_.trait_ { let trait_did = trait_.def_id(); - if cx.cache().traits.get(&trait_did).map_or(false, |t| t.is_notable_trait(cx.tcx())) - { + if cx.cache().traits.get(&trait_did).is_some_and(|t| t.is_notable_trait(cx.tcx())) { has_notable_trait = true; } } @@ -1417,7 +1416,7 @@ fn notable_traits_decl(ty: &clean::Type, cx: &Context<'_>) -> (String, String) { if let Some(trait_) = &impl_.trait_ { let trait_did = trait_.def_id(); - if cx.cache().traits.get(&trait_did).map_or(false, |t| t.is_notable_trait(cx.tcx())) { + if cx.cache().traits.get(&trait_did).is_some_and(|t| t.is_notable_trait(cx.tcx())) { if out.is_empty() { write!( &mut out, |
