commit 0171e6c9709705018a2662fc3154fc3e0580b192
parent 708be8570987eb86c8ccd41d121d564c2b26bb83
Author: William Casarin <jb55@jb55.com>
Date: Thu, 28 Nov 2024 09:31:34 -0800
clippy: fix clippy warnings
Signed-off-by: William Casarin <jb55@jb55.com>
Diffstat:
13 files changed, 27 insertions(+), 27 deletions(-)
diff --git a/enostr/src/profile.rs b/enostr/src/profile.rs
@@ -9,30 +9,30 @@ impl Profile {
}
pub fn name(&self) -> Option<&str> {
- return self.0["name"].as_str();
+ self.0["name"].as_str()
}
pub fn display_name(&self) -> Option<&str> {
- return self.0["display_name"].as_str();
+ self.0["display_name"].as_str()
}
pub fn lud06(&self) -> Option<&str> {
- return self.0["lud06"].as_str();
+ self.0["lud06"].as_str()
}
pub fn lud16(&self) -> Option<&str> {
- return self.0["lud16"].as_str();
+ self.0["lud16"].as_str()
}
pub fn about(&self) -> Option<&str> {
- return self.0["about"].as_str();
+ self.0["about"].as_str()
}
pub fn picture(&self) -> Option<&str> {
- return self.0["picture"].as_str();
+ self.0["picture"].as_str()
}
pub fn website(&self) -> Option<&str> {
- return self.0["website"].as_str();
+ self.0["website"].as_str()
}
}
diff --git a/enostr/src/relay/pool.rs b/enostr/src/relay/pool.rs
@@ -18,7 +18,7 @@ pub struct PoolEvent<'a> {
pub event: ewebsock::WsEvent,
}
-impl<'a> PoolEvent<'a> {
+impl PoolEvent<'_> {
pub fn into_owned(self) -> PoolEventBuf {
PoolEventBuf {
relay: self.relay.to_owned(),
diff --git a/src/ui/account_login_view.rs b/src/ui/account_login_view.rs
@@ -152,7 +152,7 @@ mod preview {
}
}
- impl<'a> Preview for AccountLoginView<'a> {
+ impl Preview for AccountLoginView<'_> {
type Prev = AccountLoginPreview;
fn preview(cfg: PreviewConfig) -> Self::Prev {
diff --git a/src/ui/accounts.rs b/src/ui/accounts.rs
@@ -247,7 +247,7 @@ mod preview {
}
}
- impl<'a> Preview for AccountsView<'a> {
+ impl Preview for AccountsView<'_> {
type Prev = AccountsPreview;
fn preview(_cfg: PreviewConfig) -> Self::Prev {
diff --git a/src/ui/add_column.rs b/src/ui/add_column.rs
@@ -460,7 +460,7 @@ mod preview {
}
}
- impl<'a> Preview for AddColumnView<'a> {
+ impl Preview for AddColumnView<'_> {
type Prev = AddColumnPreview;
fn preview(_cfg: PreviewConfig) -> Self::Prev {
diff --git a/src/ui/mention.rs b/src/ui/mention.rs
@@ -40,7 +40,7 @@ impl<'a> Mention<'a> {
}
}
-impl<'a> egui::Widget for Mention<'a> {
+impl egui::Widget for Mention<'_> {
fn ui(self, ui: &mut egui::Ui) -> egui::Response {
mention_ui(
self.ndb,
diff --git a/src/ui/note/mod.rs b/src/ui/note/mod.rs
@@ -61,7 +61,7 @@ impl NoteResponse {
}
}
-impl<'a> View for NoteView<'a> {
+impl View for NoteView<'_> {
fn ui(&mut self, ui: &mut egui::Ui) {
self.show(ui);
}
diff --git a/src/ui/note/post.rs b/src/ui/note/post.rs
@@ -296,7 +296,7 @@ mod preview {
}
}
- impl<'a> Preview for PostView<'a> {
+ impl Preview for PostView<'_> {
type Prev = PostPreview;
fn preview(_cfg: PreviewConfig) -> Self::Prev {
diff --git a/src/ui/profile/picture.rs b/src/ui/profile/picture.rs
@@ -9,7 +9,7 @@ pub struct ProfilePic<'cache, 'url> {
size: f32,
}
-impl<'cache, 'url> egui::Widget for ProfilePic<'cache, 'url> {
+impl egui::Widget for ProfilePic<'_, '_> {
fn ui(self, ui: &mut egui::Ui) -> egui::Response {
render_pfp(ui, self.cache, self.url, self.size)
}
@@ -209,7 +209,7 @@ mod preview {
}
}
- impl<'cache, 'url> Preview for ProfilePic<'cache, 'url> {
+ impl Preview for ProfilePic<'_, '_> {
type Prev = ProfilePicPreview;
fn preview(_cfg: PreviewConfig) -> Self::Prev {
diff --git a/src/ui/profile/preview.rs b/src/ui/profile/preview.rs
@@ -77,7 +77,7 @@ impl<'a, 'cache> ProfilePreview<'a, 'cache> {
}
}
-impl<'a, 'cache> egui::Widget for ProfilePreview<'a, 'cache> {
+impl egui::Widget for ProfilePreview<'_, '_> {
fn ui(self, ui: &mut egui::Ui) -> egui::Response {
ui.vertical(|ui| {
ui.add_sized([ui.available_size().x, 80.0], |ui: &mut egui::Ui| {
@@ -101,7 +101,7 @@ impl<'a, 'cache> SimpleProfilePreview<'a, 'cache> {
}
}
-impl<'a, 'cache> egui::Widget for SimpleProfilePreview<'a, 'cache> {
+impl egui::Widget for SimpleProfilePreview<'_, '_> {
fn ui(self, ui: &mut egui::Ui) -> egui::Response {
Frame::none()
.show(ui, |ui| {
@@ -124,7 +124,7 @@ mod previews {
cache: ImageCache,
}
- impl<'a> ProfilePreviewPreview<'a> {
+ impl ProfilePreviewPreview<'_> {
pub fn new() -> Self {
let profile = test_profile_record();
let path = DataPath::new("previews")
@@ -135,19 +135,19 @@ mod previews {
}
}
- impl<'a> Default for ProfilePreviewPreview<'a> {
+ impl Default for ProfilePreviewPreview<'_> {
fn default() -> Self {
ProfilePreviewPreview::new()
}
}
- impl<'a> View for ProfilePreviewPreview<'a> {
+ impl View for ProfilePreviewPreview<'_> {
fn ui(&mut self, ui: &mut egui::Ui) {
ProfilePreview::new(&self.profile, &mut self.cache).ui(ui);
}
}
- impl<'a, 'cache> Preview for ProfilePreview<'a, 'cache> {
+ impl<'a> Preview for ProfilePreview<'a, '_> {
/// A preview of the profile preview :D
type Prev = ProfilePreviewPreview<'a>;
diff --git a/src/ui/relay.rs b/src/ui/relay.rs
@@ -9,7 +9,7 @@ pub struct RelayView<'a> {
manager: RelayPoolManager<'a>,
}
-impl<'a> View for RelayView<'a> {
+impl View for RelayView<'_> {
fn ui(&mut self, ui: &mut egui::Ui) {
ui.add_space(24.0);
@@ -200,7 +200,7 @@ mod preview {
}
}
- impl<'a> Preview for RelayView<'a> {
+ impl Preview for RelayView<'_> {
type Prev = RelayViewPreview;
fn preview(_cfg: PreviewConfig) -> Self::Prev {
diff --git a/src/ui/side_panel.rs b/src/ui/side_panel.rs
@@ -27,7 +27,7 @@ pub struct DesktopSidePanel<'a> {
selected_account: Option<&'a UserAccount>,
}
-impl<'a> View for DesktopSidePanel<'a> {
+impl View for DesktopSidePanel<'_> {
fn ui(&mut self, ui: &mut egui::Ui) {
self.show(ui);
}
@@ -461,7 +461,7 @@ mod preview {
}
}
- impl<'a> Preview for DesktopSidePanel<'a> {
+ impl Preview for DesktopSidePanel<'_> {
type Prev = DesktopSidePanelPreview;
fn preview(_cfg: PreviewConfig) -> Self::Prev {
diff --git a/src/ui/username.rs b/src/ui/username.rs
@@ -32,7 +32,7 @@ impl<'a> Username<'a> {
}
}
-impl<'a> Widget for Username<'a> {
+impl Widget for Username<'_> {
fn ui(self, ui: &mut egui::Ui) -> egui::Response {
ui.horizontal(|ui| {
ui.spacing_mut().item_spacing.x = 0.0;