proc_macro: Specialize Punct::to_string
This was removed in a previous part, however it should be specialized for to_string performance and consistency.
This commit is contained in:
parent
17e96879d8
commit
e0dce6ec8d
1 changed files with 7 additions and 0 deletions
|
@ -1004,6 +1004,13 @@ impl Punct {
|
|||
}
|
||||
}
|
||||
|
||||
#[stable(feature = "proc_macro_lib2", since = "1.29.0")]
|
||||
impl ToString for Punct {
|
||||
fn to_string(&self) -> String {
|
||||
self.as_char().to_string()
|
||||
}
|
||||
}
|
||||
|
||||
/// Prints the punctuation character as a string that should be losslessly convertible
|
||||
/// back into the same character.
|
||||
#[stable(feature = "proc_macro_lib2", since = "1.29.0")]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue