diff options
| author | Yotam Ofek <yotam.ofek@gmail.com> | 2025-09-23 01:04:04 +0300 |
|---|---|---|
| committer | Yotam Ofek <yotam.ofek@gmail.com> | 2025-09-23 17:29:47 +0300 |
| commit | aaff372f4b45f88dc3b28fe3c1c8ec22cb3b3411 (patch) | |
| tree | 5e8f88f7c6bfdf7a2a8f04f5787f7e9b3f7d7ab3 /src/librustdoc/html/markdown.rs | |
| parent | 58c7505d868515eb55971cf1ad8744c81d5ea7d2 (diff) | |
| download | rust-aaff372f4b45f88dc3b28fe3c1c8ec22cb3b3411.tar.gz rust-aaff372f4b45f88dc3b28fe3c1c8ec22cb3b3411.zip | |
Remove `Tooltip::None` variant, use `Option::None`
Diffstat (limited to 'src/librustdoc/html/markdown.rs')
| -rw-r--r-- | src/librustdoc/html/markdown.rs | 30 |
1 files changed, 17 insertions, 13 deletions
diff --git a/src/librustdoc/html/markdown.rs b/src/librustdoc/html/markdown.rs index 46923d1f698..7065de14c8e 100644 --- a/src/librustdoc/html/markdown.rs +++ b/src/librustdoc/html/markdown.rs @@ -321,18 +321,22 @@ impl<'a, I: Iterator<Item = Event<'a>>> Iterator for CodeBlocks<'_, 'a, I> { )) }); - let tooltip = if ignore == Ignore::All { - highlight::Tooltip::IgnoreAll - } else if let Ignore::Some(platforms) = ignore { - highlight::Tooltip::IgnoreSome(platforms) - } else if compile_fail { - highlight::Tooltip::CompileFail - } else if should_panic { - highlight::Tooltip::ShouldPanic - } else if explicit_edition { - highlight::Tooltip::Edition(edition) - } else { - highlight::Tooltip::None + let tooltip = { + use highlight::Tooltip::*; + + if ignore == Ignore::All { + Some(IgnoreAll) + } else if let Ignore::Some(platforms) = ignore { + Some(IgnoreSome(platforms)) + } else if compile_fail { + Some(CompileFail) + } else if should_panic { + Some(ShouldPanic) + } else if explicit_edition { + Some(Edition(edition)) + } else { + None + } }; // insert newline to clearly separate it from the @@ -341,7 +345,7 @@ impl<'a, I: Iterator<Item = Event<'a>>> Iterator for CodeBlocks<'_, 'a, I> { "\n{}", highlight::render_example_with_highlighting( &text, - &tooltip, + tooltip.as_ref(), playground_button.as_deref(), &added_classes, ) |
