diff --git a/lez/wallet-ffi/src/label.rs b/lez/wallet-ffi/src/label.rs index 3f109409..1f6f1236 100644 --- a/lez/wallet-ffi/src/label.rs +++ b/lez/wallet-ffi/src/label.rs @@ -265,7 +265,7 @@ pub unsafe extern "C" fn wallet_ffi_get_all_labels_for_account( .storage() .labels_for_account(account_id_with_privacy.into()) { - let Ok(label_c) = CString::from_str(label.inner()) else { + let Ok(label_c) = CString::from_str(label.as_ref()) else { print_error(format!("Failed to cast label into C string: {label}")); return LabelList::error(WalletFfiError::InternalError); }; diff --git a/lez/wallet/src/account.rs b/lez/wallet/src/account.rs index 28070a6e..8caa7366 100644 --- a/lez/wallet/src/account.rs +++ b/lez/wallet/src/account.rs @@ -19,9 +19,10 @@ impl Label { pub fn new(label: impl ToString) -> Self { Self(label.to_string()) } +} - #[must_use] - pub fn inner(&self) -> &str { +impl AsRef for Label { + fn as_ref(&self) -> &str { &self.0 } }