Skip to content

Commit

Permalink
clippy postbox cleanups
Browse files Browse the repository at this point in the history
Signed-off-by: William Casarin <[email protected]>
  • Loading branch information
jb55 committed Jun 20, 2024
1 parent 395ff57 commit bb6c68e
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 8 deletions.
5 changes: 2 additions & 3 deletions src/ui/note/post.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
use crate::app::Damus;
use crate::draft::Draft;
use crate::ui::{Preview, PreviewConfig, View};
use crate::{ui, Error};
use egui::widgets::text_edit::TextEdit;
Expand Down Expand Up @@ -45,7 +44,7 @@ impl<'app, 'p> PostView<'app, 'p> {
let poster_pfp = self
.app
.ndb
.get_profile_by_pubkey(&txn, poster_pubkey)
.get_profile_by_pubkey(txn, poster_pubkey)
.as_ref()
.ok()
.and_then(|p| ui::ProfilePic::from_profile(&mut self.app.img_cache, p));
Expand All @@ -66,7 +65,7 @@ impl<'app, 'p> PostView<'app, 'p> {
.app
.drafts
.entry(enostr::NoteId::new(*self.replying_to))
.or_insert_with(|| Draft::new());
.or_default();

ui.add(TextEdit::multiline(&mut draft.buffer).frame(false));

Expand Down
10 changes: 5 additions & 5 deletions src/ui/profile/picture.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,11 @@ impl<'cache, 'url> ProfilePic<'cache, 'url> {
cache: &'cache mut ImageCache,
profile: &nostrdb::ProfileRecord<'url>,
) -> Option<Self> {
if let Some(url) = profile.record().profile().and_then(|p| p.picture()) {
Some(ProfilePic::new(cache, url))
} else {
None
}
profile
.record()
.profile()
.and_then(|p| p.picture())
.map(|url| ProfilePic::new(cache, url))
}

pub fn default_size() -> f32 {
Expand Down

0 comments on commit bb6c68e

Please sign in to comment.