Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use as_deref() to replace as_ref().map(...) #67897

Merged
merged 1 commit into from
Jan 6, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/librustdoc/html/render.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2152,7 +2152,7 @@ fn stability_tags(item: &clean::Item) -> String {
}

if let Some(stab) = item.stability.as_ref().filter(|s| s.level == stability::Unstable) {
if stab.feature.as_ref().map(|s| &**s) == Some("rustc_private") {
if stab.feature.as_deref() == Some("rustc_private") {
tags += &tag_html("internal", "Internal");
} else {
tags += &tag_html("unstable", "Experimental");
Expand Down Expand Up @@ -2205,7 +2205,7 @@ fn short_stability(item: &clean::Item, cx: &Context) -> Vec<String> {
}

if let Some(stab) = item.stability.as_ref().filter(|stab| stab.level == stability::Unstable) {
let is_rustc_private = stab.feature.as_ref().map(|s| &**s) == Some("rustc_private");
let is_rustc_private = stab.feature.as_deref() == Some("rustc_private");

let mut message = if is_rustc_private {
"<span class='emoji'>⚙️</span> This is an internal compiler API."
Expand All @@ -2214,7 +2214,7 @@ fn short_stability(item: &clean::Item, cx: &Context) -> Vec<String> {
}
.to_owned();

if let Some(feature) = stab.feature.as_ref() {
if let Some(feature) = stab.feature.as_deref() {
let mut feature = format!("<code>{}</code>", Escape(&feature));
if let (Some(url), Some(issue)) = (&cx.shared.issue_tracker_base_url, stab.issue) {
feature.push_str(&format!(
Expand Down