mirror of
https://github.com/aljazceru/notedeck.git
synced 2026-01-19 16:24:19 +01:00
clippy: fix clippy warnings
Signed-off-by: William Casarin <jb55@jb55.com>
This commit is contained in:
@@ -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()
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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(),
|
||||
|
||||
@@ -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 {
|
||||
|
||||
@@ -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 {
|
||||
|
||||
@@ -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 {
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
@@ -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 {
|
||||
|
||||
@@ -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 {
|
||||
|
||||
@@ -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>;
|
||||
|
||||
|
||||
@@ -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 {
|
||||
|
||||
@@ -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 {
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user