X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=blobdiff_plain;f=lightning%2Fsrc%2Foffers%2Finvoice_error.rs;h=1b634525416acef1a249858a7d78cc44b3c03b06;hb=bdbb177469c137b958b7dde4f306e1c81b2e7f63;hp=441dae265cbb4fb9c9ed8d527e6b9b65c1e61ad1;hpb=be8797e17ab5c56582340d1f5e57f92477ede69d;p=rust-lightning diff --git a/lightning/src/offers/invoice_error.rs b/lightning/src/offers/invoice_error.rs index 441dae26..1b634525 100644 --- a/lightning/src/offers/invoice_error.rs +++ b/lightning/src/offers/invoice_error.rs @@ -15,6 +15,7 @@ use crate::offers::parse::Bolt12SemanticError; use crate::util::ser::{HighZeroBytesDroppedBigSize, Readable, WithoutLength, Writeable, Writer}; use crate::util::string::UntrustedString; +#[allow(unused_imports)] use crate::prelude::*; /// An error in response to an [`InvoiceRequest`] or an [`Bolt12Invoice`]. @@ -50,10 +51,10 @@ pub struct ErroneousField { impl InvoiceError { /// Creates an [`InvoiceError`] with the given message. - pub fn from_str(s: &str) -> Self { + pub fn from_string(s: String) -> Self { Self { erroneous_field: None, - message: UntrustedString(s.to_string()), + message: UntrustedString(s), } } }