projects
/
ldk-c-bindings
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (from parent 1:
6728a81
)
Implement additional `Into<Str>` auto-conversion
author
Matt Corallo
<git@bluematt.me>
Mon, 1 Nov 2021 18:35:43 +0000
(18:35 +0000)
committer
Matt Corallo
<git@bluematt.me>
Tue, 2 Nov 2021 16:54:45 +0000
(16:54 +0000)
lightning-c-bindings/src/c_types/mod.rs
patch
|
blob
|
history
diff --git
a/lightning-c-bindings/src/c_types/mod.rs
b/lightning-c-bindings/src/c_types/mod.rs
index 69319563b72a8c2fd284fda2de9f7a9de460731f..c0c44bcf7470ae4b65924b2b552b012b2fb9f688 100644
(file)
--- a/
lightning-c-bindings/src/c_types/mod.rs
+++ b/
lightning-c-bindings/src/c_types/mod.rs
@@
-450,6
+450,13
@@
impl Into<Str> for &'static str {
Str { chars: self.as_ptr(), len: self.len(), chars_is_owned: false }
}
}
Str { chars: self.as_ptr(), len: self.len(), chars_is_owned: false }
}
}
+impl Into<Str> 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 ""; }
impl Str {
pub(crate) fn into_str(&self) -> &'static str {
if self.len == 0 { return ""; }