Fix .to_string() of proc_macro::Literal (properly print cstr literals)
This commit is contained in:
@@ -1411,7 +1411,15 @@ impl Literal {
|
||||
let hashes = get_hashes_str(n);
|
||||
f(&["br", hashes, "\"", symbol, "\"", hashes, suffix])
|
||||
}
|
||||
_ => f(&[symbol, suffix]),
|
||||
bridge::LitKind::CStr => f(&["c\"", symbol, "\"", suffix]),
|
||||
bridge::LitKind::CStrRaw(n) => {
|
||||
let hashes = get_hashes_str(n);
|
||||
f(&["cr", hashes, "\"", symbol, "\"", hashes, suffix])
|
||||
}
|
||||
|
||||
bridge::LitKind::Integer | bridge::LitKind::Float | bridge::LitKind::Err => {
|
||||
f(&[symbol, suffix])
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user