MCPcopy Create free account
hub / github.com/bitcoindevkit/bdk-cli / shorten

Function shorten

src/utils.rs:380–390  ·  view source on GitHub ↗
(displayable: impl Display, start: u8, end: u8)

Source from the content-addressed store, hash-verified

378}
379
380pub(crate) fn shorten(displayable: impl Display, start: u8, end: u8) -> String {
381 let displayable = displayable.to_string();
382
383 if displayable.len() <= (start + end) as usize {
384 return displayable;
385 }
386
387 let start_str: &str = &displayable[0..start as usize];
388 let end_str: &str = &displayable[displayable.len() - end as usize..];
389 format!("{start_str}...{end_str}")
390}
391
392pub fn is_mnemonic(s: &str) -> bool {
393 let word_count = s.split_whitespace().count();

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected