From 9d0db8cf4576ba68540287118de35bde9337c028 Mon Sep 17 00:00:00 2001 From: Matt Corallo Date: Mon, 1 Nov 2021 18:35:43 +0000 Subject: [PATCH] Implement additional `Into` auto-conversion --- lightning-c-bindings/src/c_types/mod.rs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/lightning-c-bindings/src/c_types/mod.rs b/lightning-c-bindings/src/c_types/mod.rs index 6931956..c0c44bc 100644 --- a/lightning-c-bindings/src/c_types/mod.rs +++ b/lightning-c-bindings/src/c_types/mod.rs @@ -450,6 +450,13 @@ impl Into for &'static str { Str { chars: self.as_ptr(), len: self.len(), chars_is_owned: false } } } +impl Into for &mut &'static str { + fn into(self) -> Str { + let us: &'static str = *self; + us.into() + } +} + impl Str { pub(crate) fn into_str(&self) -> &'static str { if self.len == 0 { return ""; } -- 2.30.2