Skip to content

Commit

Permalink
cargo fmt
Browse files Browse the repository at this point in the history
  • Loading branch information
mikedilger committed Nov 15, 2023
1 parent afc2973 commit d51f485
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 32 deletions.
45 changes: 21 additions & 24 deletions gossip-bin/src/ui/feed/note/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -722,31 +722,28 @@ fn render_note_inner(
{
app.draft_data.draft.push(' ');
}
let nostr_url: NostrUrl = if note
.event
.kind
.is_replaceable()
{
let param = match note.event.parameter() {
Some(p) => p,
None => "".to_owned(),
};
let event_addr = EventAddr {
d: param,
relays: relays.clone(),
kind: note.event.kind,
author: note.event.pubkey,
};
event_addr.into()
} else {
let event_pointer = EventPointer {
id: note.event.id,
relays: relays.clone(),
author: None,
kind: None,
let nostr_url: NostrUrl =
if note.event.kind.is_replaceable() {
let param = match note.event.parameter() {
Some(p) => p,
None => "".to_owned(),
};
let event_addr = EventAddr {
d: param,
relays: relays.clone(),
kind: note.event.kind,
author: note.event.pubkey,
};
event_addr.into()
} else {
let event_pointer = EventPointer {
id: note.event.id,
relays: relays.clone(),
author: None,
kind: None,
};
event_pointer.into()
};
event_pointer.into()
};
app.draft_data
.draft
.push_str(&format!("{}", nostr_url));
Expand Down
19 changes: 11 additions & 8 deletions gossip-lib/src/storage/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -487,9 +487,9 @@ impl Storage {
let txn = self.env.read_txn()?;

Ok(self
.general
.get(&txn, b"migration_level")?
.map(|bytes| u32::from_be_bytes(bytes[..4].try_into().unwrap())))
.general
.get(&txn, b"migration_level")?
.map(|bytes| u32::from_be_bytes(bytes[..4].try_into().unwrap())))
}

/// Write the user's encrypted private key
Expand Down Expand Up @@ -1218,12 +1218,15 @@ impl Storage {
&[event.kind],
&[event.pubkey],
None,
|e| if event.kind.is_parameterized_replaceable() {
e.parameter() == event.parameter()
} else {
true
|e| {
if event.kind.is_parameterized_replaceable() {
e.parameter() == event.parameter()
} else {
true
}
},
false)?;
false,
)?;

let mut found_newer = false;
for old in existing {
Expand Down

0 comments on commit d51f485

Please sign in to comment.