mirror of
https://github.com/mikedilger/gossip.git
synced 2024-09-19 19:46:50 +00:00
clippy and fmt
This commit is contained in:
parent
7540ee473a
commit
0990806d45
@ -384,12 +384,12 @@ impl People {
|
||||
if score > 0 {
|
||||
// if there is not a name, fallback to showing the initial chars of the pubkey,
|
||||
// but this is probably unnecessary and will never happen
|
||||
if result_name == "" {
|
||||
if result_name.is_empty() {
|
||||
result_name = person.pubkey.to_string();
|
||||
}
|
||||
|
||||
// bigger names have a higher match chance, but they should be scored lower
|
||||
score = score - result_name.len() as u16;
|
||||
score -= result_name.len() as u16;
|
||||
|
||||
return Some((score, result_name, person.pubkey.clone()));
|
||||
}
|
||||
@ -405,7 +405,7 @@ impl People {
|
||||
results.len()
|
||||
};
|
||||
results[0..max]
|
||||
.into_iter()
|
||||
.iter()
|
||||
.map(|r| (r.1.to_owned(), r.2.clone()))
|
||||
.collect()
|
||||
}
|
||||
|
@ -186,9 +186,11 @@ fn real_posting_area(app: &mut GossipUi, ctx: &Context, frame: &mut eframe::Fram
|
||||
let idx = app
|
||||
.draft_tags
|
||||
.iter()
|
||||
.position(|tag| match tag {
|
||||
Tag::Pubkey { pubkey, .. } if pubkey.0 == *pair.1 => true,
|
||||
_ => false,
|
||||
.position(|tag| {
|
||||
matches!(
|
||||
tag,
|
||||
Tag::Pubkey { pubkey, .. } if pubkey.0 == *pair.1
|
||||
)
|
||||
})
|
||||
.unwrap_or_else(|| {
|
||||
app.draft_tags.push(Tag::Pubkey {
|
||||
|
Loading…
Reference in New Issue
Block a user