Skip to content

Commit 4699b5f

Browse files
impl Display instead of to_string directly
1 parent 4d0dfaa commit 4699b5f

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

orange-sdk/src/ffi/ldk_node.rs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,15 +37,19 @@ impl Mnemonic {
3737
Err(_) => Err(ConfigError::InvalidMnemonic),
3838
}
3939
}
40+
}
4041

41-
pub fn to_string(&self) -> String {
42-
self.0.to_string()
42+
impl std::fmt::Display for Mnemonic {
43+
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
44+
write!(f, "{}", self.0)
4345
}
4446
}
4547

4648
impl_from_core_type!(LDKMnemonic, Mnemonic);
4749
impl_into_core_type!(Mnemonic, LDKMnemonic);
4850

51+
52+
4953
#[derive(Debug, Clone, uniffi::Object)]
5054
pub struct ChannelDetails(pub LDKChannelDetails);
5155

0 commit comments

Comments
 (0)