]> git.bitcoin.ninja Git - rust-lightning/commit
Remove unneeded allocation
authorMartin Habovstiak <martin.habovstiak@gmail.com>
Thu, 4 May 2023 09:21:04 +0000 (11:21 +0200)
committerMartin Habovstiak <martin.habovstiak@gmail.com>
Thu, 4 May 2023 09:21:04 +0000 (11:21 +0200)
commit6964299fc53920de68ee1e448301e6b4d82ce2ed
tree5e6fd0903c9eba548f0830d49ed919cbf22036b7
parent56b0c9683864d6860aa117b80470eda64e104854
Remove unneeded allocation

`<E as serde::de::Error>::custom()` accepts any `T: Display`, not just
`String`. Therefore it accepts `Arguments<'_>` too so we can use
`format_args!()` instead of `format!()`.

See https://github.com/lightningdevkit/rust-lightning/pull/2187#discussion_r1168781355
lightning-invoice/src/lib.rs