mirror of https://github.com/zkat/miette.git
fix: remove unused code
This commit is contained in:
parent
7a4d759c59
commit
98e0ac97f3
|
|
@ -1,41 +1,9 @@
|
|||
use proc_macro2::TokenStream;
|
||||
use quote::{format_ident, quote, ToTokens};
|
||||
use quote::{format_ident, quote};
|
||||
use syn::{
|
||||
parse::{Parse, ParseStream},
|
||||
spanned::Spanned,
|
||||
};
|
||||
|
||||
pub(crate) enum MemberOrString {
|
||||
Member(syn::Member),
|
||||
String(syn::LitStr),
|
||||
}
|
||||
|
||||
impl ToTokens for MemberOrString {
|
||||
fn to_tokens(&self, tokens: &mut TokenStream) {
|
||||
use MemberOrString::*;
|
||||
match self {
|
||||
Member(member) => member.to_tokens(tokens),
|
||||
String(string) => string.to_tokens(tokens),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl Parse for MemberOrString {
|
||||
fn parse(input: ParseStream) -> syn::Result<Self> {
|
||||
let lookahead = input.lookahead1();
|
||||
if lookahead.peek(syn::Ident) || lookahead.peek(syn::LitInt) {
|
||||
Ok(MemberOrString::Member(input.parse()?))
|
||||
} else if lookahead.peek(syn::LitStr) {
|
||||
Ok(MemberOrString::String(input.parse()?))
|
||||
} else {
|
||||
Err(syn::Error::new(
|
||||
input.span(),
|
||||
"Expected a string or a field reference.",
|
||||
))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
use crate::{
|
||||
diagnostic::{DiagnosticConcreteArgs, DiagnosticDef},
|
||||
forward::WhichFn,
|
||||
|
|
|
|||
|
|
@ -70,7 +70,6 @@ impl Drop for EnvVarGuard<'_> {
|
|||
|
||||
static COLOR_ENV_VARS: Mutex<()> = Mutex::new(());
|
||||
|
||||
|
||||
/// Assert the color format used by a handler with different levels of terminal
|
||||
/// support.
|
||||
fn check_colors<F: Fn(MietteHandlerOpts) -> MietteHandlerOpts>(
|
||||
|
|
|
|||
|
|
@ -376,6 +376,7 @@ enum NestedEnumError {
|
|||
},
|
||||
}
|
||||
|
||||
#[cfg(feature = "fancy-no-backtrace")]
|
||||
#[derive(Debug, miette::Diagnostic, thiserror::Error)]
|
||||
#[error("I am the inner error")]
|
||||
struct Case1Inner {
|
||||
|
|
|
|||
Loading…
Reference in New Issue