mirror of
https://github.com/rust-lang/rust.git
synced 2026-05-08 01:28:18 +03:00
Make Target::name method pass by copy
This commit is contained in:
@@ -60,7 +60,7 @@ pub enum Target {
|
||||
|
||||
impl Display for Target {
|
||||
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
|
||||
write!(f, "{}", Self::name(&self))
|
||||
write!(f, "{}", Self::name(*self))
|
||||
}
|
||||
}
|
||||
|
||||
@@ -142,8 +142,8 @@ pub fn from_generic_param(generic_param: &hir::GenericParam<'_>) -> Target {
|
||||
}
|
||||
}
|
||||
|
||||
pub fn name(&self) -> &str {
|
||||
match *self {
|
||||
pub fn name(self) -> &'static str {
|
||||
match self {
|
||||
Target::ExternCrate => "extern crate",
|
||||
Target::Use => "use",
|
||||
Target::Static => "static item",
|
||||
|
||||
Reference in New Issue
Block a user