Skip to content

Commit f493157

Browse files
committed
Accept clippy's suggestion for lint mismatched_lifetime_syntaxes
1 parent 98e2395 commit f493157

File tree

7 files changed

+10
-10
lines changed

7 files changed

+10
-10
lines changed

src/config/accounts.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ impl<T> Accounts<T> {
3434
self.0.contains_key(account_ref)
3535
}
3636

37-
pub fn values(&self) -> Values<String, Accessor<T>> {
37+
pub fn values(&self) -> Values<'_, String, Accessor<T>> {
3838
self.0.values()
3939
}
4040
}

src/config/secret.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ where
3535
<T as ToOwned>::Owned: FromStr,
3636
<<T as ToOwned>::Owned as FromStr>::Err: StdError + Send + Sync + 'static,
3737
{
38-
pub fn get_parse_cow(&self) -> anyhow::Result<Cow<T>> {
38+
pub fn get_parse_cow(&self) -> anyhow::Result<Cow<'_, T>> {
3939
match self {
4040
Self::Lit(lit) => Ok(Cow::Borrowed(lit)),
4141
Self::Env(key) => Ok(Cow::Owned(env::var(key)?.parse()?)),
@@ -98,7 +98,7 @@ macro_rules! secret_enum {
9898
}
9999

100100
impl $crate::config::AsSecretRef<'_> for $name {
101-
fn as_secret_ref(&self) -> $crate::config::SecretRef {
101+
fn as_secret_ref(&self) -> $crate::config::SecretRef<'_> {
102102
paste::paste! {
103103
match &*self.0 {
104104
secret_enum_private::$name::$field(value) => $crate::config::SecretRef::Lit(value),

src/platform/telegram/notify/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ impl Notifier {
128128
}
129129
}
130130

131-
fn token(&self) -> anyhow::Result<Cow<str>> {
131+
fn token(&self) -> anyhow::Result<Cow<'_, str>> {
132132
self.params
133133
.token
134134
.as_ref()

src/platform/telegram/notify/request.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -330,7 +330,7 @@ pub enum LinkPreviewOwned {
330330
}
331331

332332
impl LinkPreviewOwned {
333-
pub fn as_ref(&self) -> LinkPreview {
333+
pub fn as_ref(&self) -> LinkPreview<'_> {
334334
match self {
335335
Self::Disabled => LinkPreview::Disabled,
336336
Self::Below(url) => LinkPreview::Below(url),
@@ -492,7 +492,7 @@ pub enum MediaInput<'a> {
492492
}
493493

494494
impl MediaInput<'_> {
495-
fn to_url(&self, index: usize) -> Cow<str> {
495+
fn to_url(&self, index: usize) -> Cow<'_, str> {
496496
match self {
497497
Self::Url(url) => Cow::Borrowed(url),
498498
Self::Memory { .. } => Cow::Owned(format!("attach://{index}")),

src/prop.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ pub enum UserAgent {
2020
}
2121

2222
impl UserAgent {
23-
pub fn as_str(&self) -> Cow<str> {
23+
pub fn as_str(&self) -> Cow<'_, str> {
2424
match self {
2525
Self::Logo => Cow::Borrowed(formatcp!(
2626
"{}/{} (FAIR USE, PLEASE DO NOT BLOCK. Source opened on github.com/SpriteOvO/{})",

src/reporter/norec.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ impl NoRec {
1212
}
1313
}
1414

15-
pub fn enter(&self) -> Option<NoRecGuard> {
15+
pub fn enter(&self) -> Option<NoRecGuard<'_>> {
1616
if self.is_recursing.fetch_or(true, Ordering::SeqCst) {
1717
None
1818
} else {

src/source/abstruct/post.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ impl Post {
4747
}
4848
}
4949

50-
pub fn urls_recursive(&self) -> PostUrlsRef {
50+
pub fn urls_recursive(&self) -> PostUrlsRef<'_> {
5151
if let Some(RepostFrom::Recursion(repost_from)) = &self.repost_from {
5252
let mut v = self
5353
.urls
@@ -80,7 +80,7 @@ impl PostUrls {
8080
self.0.first().unwrap()
8181
}
8282

83-
pub fn iter(&self) -> slice::Iter<PostUrl> {
83+
pub fn iter(&self) -> slice::Iter<'_, PostUrl> {
8484
self.0.iter()
8585
}
8686
}

0 commit comments

Comments
 (0)