mirror of
https://github.com/Noratrieb/cargo-minimize.git
synced 2026-01-16 09:15:02 +01:00
implement verbatim in prettyplease
This commit is contained in:
parent
39c186233c
commit
045e766bf3
4 changed files with 11 additions and 43 deletions
|
|
@ -160,15 +160,6 @@ impl Printer {
|
|||
self.word(")");
|
||||
}
|
||||
|
||||
#[cfg(not(feature = "verbatim"))]
|
||||
fn type_verbatim(&mut self, ty: &TokenStream) {
|
||||
if ty.to_string() == "..." {
|
||||
self.word("...");
|
||||
} else {
|
||||
unimplemented!("Type::Verbatim `{}`", ty);
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(feature = "verbatim")]
|
||||
fn type_verbatim(&mut self, tokens: &TokenStream) {
|
||||
use syn::parse::{Parse, ParseStream, Result};
|
||||
|
|
@ -194,7 +185,7 @@ impl Printer {
|
|||
|
||||
let ty: TypeVerbatim = match syn::parse2(tokens.clone()) {
|
||||
Ok(ty) => ty,
|
||||
Err(_) => unimplemented!("Type::Verbatim `{}`", tokens),
|
||||
Err(_) => return self.word(tokens.to_string()),
|
||||
};
|
||||
|
||||
match ty {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue