-
Notifications
You must be signed in to change notification settings - Fork 13.4k
Add methods properties in emoji to sidebar #67871
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
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -4063,11 +4063,25 @@ fn get_methods( | |||||
.filter_map(|item| match item.name { | ||||||
Some(ref name) if !name.is_empty() && item.is_method() => { | ||||||
if !for_deref || should_render_item(item, deref_mut) { | ||||||
Some(format!( | ||||||
"<a href=\"#{}\">{}</a>", | ||||||
get_next_url(used_links, format!("method.{}", name)), | ||||||
name | ||||||
)) | ||||||
let mut emojis = String::new(); | ||||||
if let clean::FunctionItem(ref func) | clean::ForeignFunctionItem(ref func) = item.inner { | ||||||
if func.header.unsafety == hir::Unsafety::Unsafe { | ||||||
emojis += "⚠"; | ||||||
} | ||||||
} | ||||||
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"); | ||||||
pickfire marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||
emojis += if is_rustc_private { "⚙️" } else { "🔬" }; | ||||||
}; | ||||||
if item.deprecation().is_some() { | ||||||
emojis += "⚰️"; | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I like this better
Suggested change
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Other options to consider:
I'm personally partial to 🚧 (followed by 🚩). think they convey the message of "hey, pay attention, this will go away at some point" without being too strong. EDIT: 🚧 may have too much of a "under construction, stabilizing" connotation than we would like, though. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Also, notably, MDN uses 👎 for deprecated APIs. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yeah, we should bikeshed which emoji to use, right now there is not one to use. The one I suggested is a coffin. I think I prefer 👎. Can there even be a vote or something for this? |
||||||
} | ||||||
if !emojis.is_empty() { | ||||||
emojis.insert_str(0, "<sup>"); | ||||||
emojis.push_str("</sup>"); | ||||||
} | ||||||
let url = get_next_url(used_links, format!("method.{}", name)); | ||||||
Some(format!("<a href=\"#{}\">{}{}</a>", url, name, emojis)) | ||||||
} else { | ||||||
None | ||||||
} | ||||||
|
Uh oh!
There was an error while loading. Please reload this page.