fix(wallet_ffi): asref suggestion

This commit is contained in:
Pravdyvy 2026-06-30 12:46:52 +03:00
parent fade3b488a
commit 53ae6dcfdd
2 changed files with 4 additions and 3 deletions

View File

@ -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);
};

View File

@ -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<str> for Label {
fn as_ref(&self) -> &str {
&self.0
}
}