mirror of https://github.com/zkat/miette.git
Merge a523c1888e into b466948965
This commit is contained in:
commit
15a6ae248a
|
|
@ -124,7 +124,7 @@ impl Help {
|
|||
let (fmt, args) = display.expand_shorthand_cloned(&display_members);
|
||||
Some(quote! {
|
||||
fn help(&self) -> std::option::Option<std::boxed::Box<dyn std::fmt::Display + '_>> {
|
||||
#[allow(unused_variables, deprecated)]
|
||||
#[allow(unused_variables, deprecated, unused_assignments)]
|
||||
let Self #display_pat = self;
|
||||
std::option::Option::Some(std::boxed::Box::new(format!(#fmt #args)))
|
||||
}
|
||||
|
|
@ -134,7 +134,7 @@ impl Help {
|
|||
let var = quote! { __miette_internal_var };
|
||||
Some(quote! {
|
||||
fn help(&self) -> std::option::Option<std::boxed::Box<dyn std::fmt::Display + '_>> {
|
||||
#[allow(unused_variables, deprecated)]
|
||||
#[allow(unused_variables, deprecated, unused_assignments)]
|
||||
let Self #display_pat = self;
|
||||
use miette::macro_helpers::ToOption;
|
||||
miette::macro_helpers::OptionalWrapper::<#ty>::new().to_option(&self.#member).as_ref().map(|#var| -> std::boxed::Box<dyn std::fmt::Display + '_> { std::boxed::Box::new(format!("{}", #var)) })
|
||||
|
|
|
|||
|
|
@ -225,7 +225,7 @@ impl Labels {
|
|||
});
|
||||
|
||||
Some(quote! {
|
||||
#[allow(unused_variables)]
|
||||
#[allow(unused_variables, unused_assignments)]
|
||||
fn labels(&self) -> std::option::Option<std::boxed::Box<dyn std::iter::Iterator<Item = miette::LabeledSpan> + '_>> {
|
||||
use miette::macro_helpers::ToOption;
|
||||
let Self #display_pat = self;
|
||||
|
|
|
|||
|
|
@ -73,7 +73,7 @@ impl SourceCode {
|
|||
};
|
||||
|
||||
Some(quote! {
|
||||
#[allow(unused_variables)]
|
||||
#[allow(unused_variables, unused_assignments)]
|
||||
fn source_code(&self) -> std::option::Option<&dyn miette::SourceCode> {
|
||||
let Self #display_pat = self;
|
||||
#ret
|
||||
|
|
|
|||
|
|
@ -130,7 +130,7 @@ impl Url {
|
|||
};
|
||||
Some(quote! {
|
||||
fn url(&self) -> std::option::Option<std::boxed::Box<dyn std::fmt::Display + '_>> {
|
||||
#[allow(unused_variables, deprecated)]
|
||||
#[allow(unused_variables, deprecated, unused_assignments)]
|
||||
let Self #pat = self;
|
||||
std::option::Option::Some(std::boxed::Box::new(format!(#fmt #args)))
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue