Merge pull request #71 from TheBlueMatt/main
authorMatt Corallo <649246+TheBlueMatt@users.noreply.github.com>
Mon, 18 Apr 2022 12:53:05 +0000 (12:53 +0000)
committerGitHub <noreply@github.com>
Mon, 18 Apr 2022 12:53:05 +0000 (12:53 +0000)
Make `Str`'s `clone` always clone the underlying bytes

lightning-c-bindings/src/c_types/mod.rs

index 1e88f0521e53c8ce56372278b3dcb17d3e4db3e5..12c70888b20585ef73b9872dbbb892251af09795 100644 (file)
@@ -569,7 +569,7 @@ impl Into<Str> for String {
 }
 impl Clone for Str {
        fn clone(&self) -> Self {
-               self.into_str().clone().into()
+               String::from(self.into_str()).into()
        }
 }