Skip to content

Commit

Permalink
Apply clippy for lints needless_lifetimes and elided_named_lifetimes
Browse files Browse the repository at this point in the history
  • Loading branch information
SpriteOvO committed Dec 19, 2024
1 parent 819dc4a commit 06d0189
Show file tree
Hide file tree
Showing 7 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,7 @@ impl NotifyMap {
}

pub trait AsSecretRef<'a, T = &'a str> {
fn as_secret_ref(&'a self) -> SecretRef<'_, T>;
fn as_secret_ref(&'a self) -> SecretRef<'a, T>;
}

pub enum SecretRef<'a, T = &'a str> {
Expand Down
2 changes: 1 addition & 1 deletion src/notify/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ pub trait NotifierTrait: PlatformTrait {
fn notify<'a>(
&'a self,
notification: &'a Notification<'_>,
) -> Pin<Box<dyn Future<Output = anyhow::Result<()>> + Send + '_>>;
) -> Pin<Box<dyn Future<Output = anyhow::Result<()>> + Send + 'a>>;
}

pub fn notifier(params: platform::Config) -> Box<dyn NotifierTrait> {
Expand Down
2 changes: 1 addition & 1 deletion src/notify/platform/qq/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ impl NotifierTrait for Notifier {
fn notify<'a>(
&'a self,
notification: &'a Notification<'_>,
) -> Pin<Box<dyn Future<Output = anyhow::Result<()>> + Send + '_>> {
) -> Pin<Box<dyn Future<Output = anyhow::Result<()>> + Send + 'a>> {
Box::pin(self.notify_impl(notification))
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/notify/platform/telegram/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ impl NotifierTrait for Notifier {
fn notify<'a>(
&'a self,
notification: &'a Notification<'_>,
) -> Pin<Box<dyn Future<Output = anyhow::Result<()>> + Send + '_>> {
) -> Pin<Box<dyn Future<Output = anyhow::Result<()>> + Send + 'a>> {
Box::pin(self.notify_impl(notification))
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/notify/platform/telegram/request.rs
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,7 @@ pub enum Markup<'a> {
InlineKeyboard(Vec<Vec<Button<'a>>>),
}

impl<'a> Markup<'a> {
impl Markup<'_> {
fn into_json(self) -> json::Value {
match self {
Markup::InlineKeyboard(buttons) => {
Expand Down
2 changes: 1 addition & 1 deletion src/reporter/norec.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ pub struct NoRecGuard<'a> {
no_rec: &'a NoRec,
}

impl<'a> Drop for NoRecGuard<'a> {
impl Drop for NoRecGuard<'_> {
fn drop(&mut self) {
self.no_rec.exit();
}
Expand Down
6 changes: 3 additions & 3 deletions src/source/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -377,7 +377,7 @@ pub struct Notification<'a> {
pub source: &'a StatusSource,
}

impl<'a> fmt::Display for Notification<'a> {
impl fmt::Display for Notification<'_> {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
write!(f, "{}", self.kind)
}
Expand All @@ -391,7 +391,7 @@ pub enum NotificationKind<'a> {
Log(String),
}

impl<'a> fmt::Display for NotificationKind<'a> {
impl fmt::Display for NotificationKind<'_> {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
match self {
Self::LiveOnline(live_status) => write!(f, "{live_status}"),
Expand All @@ -411,7 +411,7 @@ pub trait FetcherTrait: PlatformTrait + Display {
fn post_filter<'a>(
&'a self,
notification: Notification<'a>,
) -> Pin<Box<dyn Future<Output = Option<Notification<'a>>> + Send + '_>> {
) -> Pin<Box<dyn Future<Output = Option<Notification<'a>>> + Send + 'a>> {
Box::pin(async move { Some(notification) })
}
}
Expand Down

0 comments on commit 06d0189

Please sign in to comment.