chore: remove AsRef impl from the StringLiteral macro since I don't like that behavior, reorganize it to prevent leaking proc-macro2 / syn / quote
This commit is contained in:
@@ -11,11 +11,11 @@ pub struct WrongLiteralError<S> {
|
||||
|
||||
impl<S> Display for WrongLiteralError<S>
|
||||
where
|
||||
S: AsRef<str>,
|
||||
&'static str: for<'a> From<&'a S>,
|
||||
{
|
||||
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
||||
let Self { actual, expected } = self;
|
||||
let expected_str = expected.as_ref();
|
||||
let expected_str = <&'static str>::from(&expected);
|
||||
|
||||
write!(f, "expected {expected_str:?} but got {actual:?}")
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user