Skip to content

Commit

Permalink
clippy fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
englut committed Dec 9, 2024
1 parent 83a2983 commit d1882ab
Show file tree
Hide file tree
Showing 7 changed files with 18 additions and 18 deletions.
12 changes: 6 additions & 6 deletions data/src/user.rs
Original file line number Diff line number Diff line change
Expand Up @@ -316,37 +316,37 @@ impl<'a> From<&'a str> for NickRef<'a> {
}
}

impl<'a> NickRef<'a> {
impl NickRef<'_> {
pub fn to_owned(self) -> Nick {
Nick(self.0.to_string())
}
}

impl<'a> fmt::Display for NickRef<'a> {
impl fmt::Display for NickRef<'_> {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
self.0.fmt(f)
}
}

impl<'a> AsRef<str> for NickRef<'a> {
impl AsRef<str> for NickRef<'_> {
fn as_ref(&self) -> &str {
self.0
}
}

impl<'a> PartialOrd for NickRef<'a> {
impl PartialOrd for NickRef<'_> {
fn partial_cmp(&self, other: &Self) -> Option<std::cmp::Ordering> {
Some(self.0.to_lowercase().cmp(&other.0.to_lowercase()))
}
}

impl<'a> Ord for NickRef<'a> {
impl Ord for NickRef<'_> {
fn cmp(&self, other: &Self) -> std::cmp::Ordering {
self.0.to_lowercase().cmp(&other.0.to_lowercase())
}
}

impl<'a> PartialEq<Nick> for NickRef<'a> {
impl PartialEq<Nick> for NickRef<'_> {
fn eq(&self, other: &Nick) -> bool {
self.0.eq(other.0.as_str())
}
Expand Down
2 changes: 1 addition & 1 deletion src/buffer/channel/topic.rs
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ pub fn update(message: Message) -> Option<Event> {

pub fn view<'a>(
server: &'a Server,
channel: &'a String,
channel: &'a str,
content: &'a message::Content,
who: Option<&'a str>,
time: Option<&'a DateTime<Utc>>,
Expand Down
4 changes: 2 additions & 2 deletions src/widget/anchored_overlay.rs
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ struct AnchoredOverlay<'a, Message> {
offset: f32,
}

impl<'a, Message> Widget<Message, Theme, Renderer> for AnchoredOverlay<'a, Message> {
impl<Message> Widget<Message, Theme, Renderer> for AnchoredOverlay<'_, Message> {
fn size(&self) -> Size<Length> {
self.base.as_widget().size()
}
Expand Down Expand Up @@ -184,7 +184,7 @@ struct Overlay<'a, 'b, Message> {
position: Point,
}

impl<'a, 'b, Message> overlay::Overlay<Message, Theme, Renderer> for Overlay<'a, 'b, Message> {
impl<Message> overlay::Overlay<Message, Theme, Renderer> for Overlay<'_, '_, Message> {
fn layout(&mut self, renderer: &Renderer, bounds: Size) -> layout::Node {
let height = match self.anchor {
// From top of base to top of viewport
Expand Down
4 changes: 2 additions & 2 deletions src/widget/context_menu.rs
Original file line number Diff line number Diff line change
Expand Up @@ -379,8 +379,8 @@ struct Overlay<'a, 'b, Message, Theme, Renderer> {
position: Point,
}

impl<'a, 'b, Message, Theme, Renderer> overlay::Overlay<Message, Theme, Renderer>
for Overlay<'a, 'b, Message, Theme, Renderer>
impl<Message, Theme, Renderer> overlay::Overlay<Message, Theme, Renderer>
for Overlay<'_, '_, Message, Theme, Renderer>
where
Renderer: advanced::Renderer,
{
Expand Down
8 changes: 4 additions & 4 deletions src/widget/modal.rs
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,8 @@ impl<'a, Message, Theme, Renderer> Modal<'a, Message, Theme, Renderer> {
}
}

impl<'a, Message, Theme, Renderer> Widget<Message, Theme, Renderer>
for Modal<'a, Message, Theme, Renderer>
impl<Message, Theme, Renderer> Widget<Message, Theme, Renderer>
for Modal<'_, Message, Theme, Renderer>
where
Renderer: advanced::Renderer,
{
Expand Down Expand Up @@ -173,8 +173,8 @@ struct Overlay<'a, 'b, Message, Theme, Renderer> {
on_blur: &'b dyn Fn() -> Message,
}

impl<'a, 'b, Message, Theme, Renderer> overlay::Overlay<Message, Theme, Renderer>
for Overlay<'a, 'b, Message, Theme, Renderer>
impl<Message, Theme, Renderer> overlay::Overlay<Message, Theme, Renderer>
for Overlay<'_, '_, Message, Theme, Renderer>
where
Renderer: advanced::Renderer,
{
Expand Down
4 changes: 2 additions & 2 deletions src/widget/selectable_rich_text.rs
Original file line number Diff line number Diff line change
Expand Up @@ -199,8 +199,8 @@ where
}
}

impl<'a, Message, Link, Entry, Theme, Renderer> Default
for Rich<'a, Message, Link, Entry, Theme, Renderer>
impl<Message, Link, Entry, Theme, Renderer> Default
for Rich<'_, Message, Link, Entry, Theme, Renderer>
where
Link: self::Link + 'static,
Theme: Catalog,
Expand Down
2 changes: 1 addition & 1 deletion src/widget/selectable_text.rs
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ where
}
}

impl<'a, Message, Theme, Renderer> Widget<Message, Theme, Renderer> for Text<'a, Theme, Renderer>
impl<Message, Theme, Renderer> Widget<Message, Theme, Renderer> for Text<'_, Theme, Renderer>
where
Renderer: text::Renderer,
Theme: Catalog,
Expand Down

0 comments on commit d1882ab

Please sign in to comment.