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