Skip to content

Commit

Permalink
Fix lints
Browse files Browse the repository at this point in the history
  • Loading branch information
udoprog committed Dec 27, 2024
1 parent bdc2f90 commit cd82035
Show file tree
Hide file tree
Showing 10 changed files with 24 additions and 15 deletions.
10 changes: 8 additions & 2 deletions src/commands.rs
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,10 @@ where
C: Commands<T>,
M: MaybeSend + Sync + Clone + Fn(U) -> T,
{
type ByRef<'this> = &'this mut Self where Self: 'this;
type ByRef<'this>
= &'this mut Self
where
Self: 'this;

#[inline]
fn by_ref(&mut self) -> Self::ByRef<'_> {
Expand Down Expand Up @@ -237,7 +240,10 @@ impl<C, M> Commands<M> for &mut C
where
C: Commands<M>,
{
type ByRef<'this> = C::ByRef<'this> where Self: 'this;
type ByRef<'this>
= C::ByRef<'this>
where
Self: 'this;

#[inline]
fn by_ref(&mut self) -> Self::ByRef<'_> {
Expand Down
5 changes: 4 additions & 1 deletion src/commands/buf.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,10 @@ impl<M> CommandsBuf<M> {
}

impl<M> Commands<M> for CommandsBuf<M> {
type ByRef<'this> = &'this mut Self where Self: 'this;
type ByRef<'this>
= &'this mut Self
where
Self: 'this;

#[inline]
fn by_ref(&mut self) -> Self::ByRef<'_> {
Expand Down
2 changes: 1 addition & 1 deletion src/compat/hex.rs
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ impl<'de, const N: usize> de::Deserialize<'de> for Hex<N> {

struct Visitor<const N: usize>;

impl<'de, const N: usize> de::Visitor<'de> for Visitor<N> {
impl<const N: usize> de::Visitor<'_> for Visitor<N> {
type Value = Hex<N>;

#[inline]
Expand Down
4 changes: 2 additions & 2 deletions src/context.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ pub(crate) struct CtxtRef<'a> {
pub(crate) style: &'a Style,
}

impl<'a> CtxtRef<'a> {
impl CtxtRef<'_> {
#[inline]
pub(crate) fn warning_text(&self) -> iced::theme::Text {
crate::style::warning_text(self.service.theme())
Expand Down Expand Up @@ -76,7 +76,7 @@ pub(crate) struct Ctxt<'a> {
pub(crate) assets: &'a mut Assets,
}

impl<'a> Ctxt<'a> {
impl Ctxt<'_> {
/// Push history.
pub(crate) fn push_history(&mut self, page: Page) {
self.history.push_history(self.assets, page);
Expand Down
4 changes: 2 additions & 2 deletions src/database/episodes.rs
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ impl<'a> EpisodeRef<'a> {
}
}

impl<'a> Deref for EpisodeRef<'a> {
impl Deref for EpisodeRef<'_> {
type Target = Episode;

#[inline]
Expand Down Expand Up @@ -229,7 +229,7 @@ impl<'a> Iterator for Iter<'a> {
}
}

impl<'a> DoubleEndedIterator for Iter<'a> {
impl DoubleEndedIterator for Iter<'_> {
#[inline]
fn next_back(&mut self) -> Option<Self::Item> {
let id = self.tail.take()?;
Expand Down
2 changes: 1 addition & 1 deletion src/database/iter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ where
}
}

impl<'a, I, M> Clone for Iter<'a, I, M>
impl<I, M> Clone for Iter<'_, I, M>
where
I: Clone,
M: Map,
Expand Down
4 changes: 2 additions & 2 deletions src/database/seasons.rs
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ impl fmt::Debug for SeasonRef<'_> {
}
}

impl<'a> Deref for SeasonRef<'a> {
impl Deref for SeasonRef<'_> {
type Target = Season;

#[inline]
Expand Down Expand Up @@ -202,7 +202,7 @@ impl<'a> Iterator for Iter<'a> {
}
}

impl<'a> DoubleEndedIterator for Iter<'a> {
impl DoubleEndedIterator for Iter<'_> {
#[inline]
fn next_back(&mut self) -> Option<Self::Item> {
let id = self.tail.take()?;
Expand Down
4 changes: 2 additions & 2 deletions src/model.rs
Original file line number Diff line number Diff line change
Expand Up @@ -933,7 +933,7 @@ pub(crate) mod btree_as_vec {
K: Ord + de::Deserialize<'de>,
V: de::Deserialize<'de>,
{
return deserializer.deserialize_seq(Visitor(BTreeMap::new()));
deserializer.deserialize_seq(Visitor(BTreeMap::new()))
}

impl<'de, K, V> de::Visitor<'de> for Visitor<K, V>
Expand Down Expand Up @@ -1297,7 +1297,7 @@ impl<'de> Deserialize<'de> for ImageV2 {
{
struct ImageV2Visitor;

impl<'de> de::Visitor<'de> for ImageV2Visitor {
impl de::Visitor<'_> for ImageV2Visitor {
type Value = ImageV2;

#[inline]
Expand Down
2 changes: 1 addition & 1 deletion src/model/etag.rs
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ impl ser::Serialize for Etag {

struct Visitor;

impl<'de> de::Visitor<'de> for Visitor {
impl de::Visitor<'_> for Visitor {
type Value = Etag;

#[inline]
Expand Down
2 changes: 1 addition & 1 deletion src/model/raw.rs
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ impl<const N: usize> ser::Serialize for Raw<N> {

struct Visitor<const N: usize>;

impl<'de, const N: usize> de::Visitor<'de> for Visitor<N> {
impl<const N: usize> de::Visitor<'_> for Visitor<N> {
type Value = Raw<N>;

#[inline]
Expand Down

0 comments on commit cd82035

Please sign in to comment.