Skip to content

Commit 8db99a6

Browse files
committed
chore: Fix Clippy's mismatched_lifetime_syntaxes lint
1 parent c6577b6 commit 8db99a6

2 files changed

Lines changed: 5 additions & 5 deletions

File tree

crates/stackable-operator/src/product_logging/spec.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ where
8585
T: Clone + Display + Ord,
8686
{
8787
/// Get the logging configuration for `container`, falling back to the default.
88-
pub fn for_container(&self, container: &T) -> Cow<ContainerLogConfig> {
88+
pub fn for_container(&'_ self, container: &T) -> Cow<'_, ContainerLogConfig> {
8989
self.containers
9090
.get(container)
9191
.map(Cow::Borrowed)

crates/stackable-operator/src/utils/option.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ pub trait OptionExt<T> {
99
/// Compared to [`Option::unwrap_or_else`], this saves having to [`Clone::clone`] the value to make the types line up.
1010
///
1111
/// Consider using [`Self::as_deref_or_else`] instead if the type implements [`Deref`] (such as [`String`] or [`PathBuf`]).
12-
fn as_ref_or_else(&self, default: impl FnOnce() -> T) -> Cow<T>
12+
fn as_ref_or_else(&'_ self, default: impl FnOnce() -> T) -> Cow<'_, T>
1313
where
1414
T: Clone;
1515

@@ -18,22 +18,22 @@ pub trait OptionExt<T> {
1818
/// Compared to [`Option::unwrap_or_else`], this saves having to [`Clone::clone`] the value to make the types line up.
1919
///
2020
/// Consider using [`Self::as_ref_or_else`] instead if the type does not implement [`Deref`].
21-
fn as_deref_or_else(&self, default: impl FnOnce() -> T) -> Cow<T::Target>
21+
fn as_deref_or_else(&'_ self, default: impl FnOnce() -> T) -> Cow<'_, T::Target>
2222
where
2323
T: Deref,
2424
T::Target: ToOwned<Owned = T>;
2525
}
2626

2727
impl<T> OptionExt<T> for Option<T> {
28-
fn as_ref_or_else(&self, default: impl FnOnce() -> T) -> Cow<T>
28+
fn as_ref_or_else(&'_ self, default: impl FnOnce() -> T) -> Cow<'_, T>
2929
where
3030
T: Clone,
3131
{
3232
self.as_ref()
3333
.map_or_else(|| Cow::Owned(default()), Cow::Borrowed)
3434
}
3535

36-
fn as_deref_or_else(&self, default: impl FnOnce() -> T) -> Cow<<T>::Target>
36+
fn as_deref_or_else(&'_ self, default: impl FnOnce() -> T) -> Cow<'_, <T>::Target>
3737
where
3838
T: Deref,
3939
<T>::Target: ToOwned<Owned = T>,

0 commit comments

Comments
 (0)