Merge pull request #2262 from Kixunil/remove-serde-error-allocation

Remove unneeded allocation
This commit is contained in:
Wilmer Paulino 2023-05-04 10:30:32 -07:00 committed by GitHub
commit bb38ed3b2e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1725,7 +1725,7 @@ impl<'de> Deserialize<'de> for Invoice {
fn deserialize<D>(deserializer: D) -> Result<Invoice, D::Error> where D: Deserializer<'de> {
let bolt11 = String::deserialize(deserializer)?
.parse::<Invoice>()
.map_err(|e| D::Error::custom(alloc::format!("{:?}", e)))?;
.map_err(|e| D::Error::custom(format_args!("{:?}", e)))?;
Ok(bolt11)
}