Skip to content

Commit b73016e

Browse files
committed
fix(no_std): replace std::string with alloc::string for compatibility
1 parent 875b5e9 commit b73016e

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

crates/chain/src/indexer/keychain_txout.rs

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ use crate::{
1010
spk_txout::SpkTxOutIndex,
1111
DescriptorExt, DescriptorId, Indexed, Indexer, KeychainIndexed, SpkIterator,
1212
};
13-
use alloc::{borrow::ToOwned, vec::Vec};
13+
use alloc::{borrow::ToOwned, string::String, string::ToString, vec::Vec};
1414
use bitcoin::{
1515
key::Secp256k1, Amount, OutPoint, Script, ScriptBuf, SignedAmount, Transaction, TxOut, Txid,
1616
};
@@ -975,11 +975,8 @@ pub enum InsertDescriptorError<K> {
975975

976976
/// Returns a shortened string representation of a descriptor.
977977
/// Shows the first and last `edge_len` characters, separated by `...`.
978-
fn short_descriptor(
979-
desc: &Descriptor<DescriptorPublicKey>,
980-
edge_len: usize,
981-
) -> std::string::String {
982-
let s = std::string::ToString::to_string(desc);
978+
fn short_descriptor(desc: &Descriptor<DescriptorPublicKey>, edge_len: usize) -> String {
979+
let s = ToString::to_string(desc);
983980
if s.len() <= edge_len * 2 {
984981
return s;
985982
}

0 commit comments

Comments
 (0)