We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
Target::name
1 parent c643007 commit 1e8abe7Copy full SHA for 1e8abe7
compiler/rustc_hir/src/target.rs
@@ -60,7 +60,7 @@ pub enum Target {
60
61
impl Display for Target {
62
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
63
- write!(f, "{}", Self::name(&self))
+ write!(f, "{}", Self::name(*self))
64
}
65
66
@@ -142,8 +142,8 @@ impl Target {
142
143
144
145
- pub fn name(&self) -> &str {
146
- match *self {
+ pub fn name(self) -> &'static str {
+ match self {
147
Target::ExternCrate => "extern crate",
148
Target::Use => "use",
149
Target::Static => "static item",
0 commit comments