remove dead code

This commit is contained in:
2026-09-13 17:11:26 +07:00
parent f6b8a5e133
commit a051cb165e
11 changed files with 320 additions and 392 deletions
+9 -2
View File
@@ -1,7 +1,14 @@
use nostr::prelude::*;
/// Shorten a [`PublicKey`] to `npub1abc...wxyz` form.
pub fn shorten_pubkey(public_key: PublicKey, len: usize) -> String {
pub fn shorten_pubkey(public_key: PublicKey) -> String {
const HEAD_CHARS: usize = 9;
const TAIL_CHARS: usize = 4;
let npub = public_key.to_bech32().unwrap();
format!("{}...{}", &npub[..(len + 5)], &npub[npub.len() - len..])
format!(
"{}...{}",
&npub[..HEAD_CHARS],
&npub[npub.len() - TAIL_CHARS..]
)
}