Skip to content

Commit d03c9cf

Browse files
committed
fix needless lifetimes clippy findings
Fixes errors from clippy nightly of the form: ``` error: the following explicit lifetimes could be elided: 'a --> src/panic.rs:43:6 | 43 | impl<'a> Defaultable for rustls_slice_bytes<'a> {} | ^^ ^^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_lifetimes = note: `-D clippy::needless-lifetimes` implied by `-D warnings` = help: to override `-D warnings` add `#[allow(clippy::needless_lifetimes)]` help: elide the lifetimes ```
1 parent 4b48d53 commit d03c9cf

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

src/panic.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ impl Defaultable for rustls_tls_version {}
4040

4141
impl<T> Defaultable for Option<T> {}
4242

43-
impl<'a> Defaultable for rustls_slice_bytes<'a> {}
43+
impl Defaultable for rustls_slice_bytes<'_> {}
4444

4545
impl<T: Defaultable> PanicOrDefault for T {
4646
fn value() -> Self {
@@ -66,7 +66,7 @@ impl PanicOrDefault for rustls_result {
6666
}
6767
}
6868

69-
impl<'a> PanicOrDefault for rustls_str<'a> {
69+
impl PanicOrDefault for rustls_str<'_> {
7070
fn value() -> Self {
7171
rustls_str::from_str_unchecked("")
7272
}
@@ -108,7 +108,7 @@ impl NullParameterOrDefault for rustls_io_result {
108108
}
109109
}
110110

111-
impl<'a> NullParameterOrDefault for rustls_str<'a> {
111+
impl NullParameterOrDefault for rustls_str<'_> {
112112
fn value() -> Self {
113113
rustls_str::from_str_unchecked("")
114114
}

src/rslice.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,7 @@ impl<'a> TryFrom<&'a str> for rustls_str<'a> {
175175
}
176176
}
177177

178-
impl<'a> Default for rustls_str<'a> {
178+
impl Default for rustls_str<'_> {
179179
fn default() -> rustls_str<'static> {
180180
Self::from_str_unchecked("")
181181
}
@@ -186,7 +186,7 @@ impl<'a> Default for rustls_str<'a> {
186186
/// The string should not have any internal NUL bytes and is not NUL terminated.
187187
/// C code should not create rustls_str objects, they should only be created in Rust
188188
/// code.
189-
impl<'a> rustls_str<'a> {
189+
impl rustls_str<'_> {
190190
pub fn from_str_unchecked(s: &'static str) -> rustls_str<'static> {
191191
rustls_str {
192192
data: s.as_ptr() as *const _,
@@ -226,7 +226,7 @@ impl<'a> rustls_str<'a> {
226226
// If the assertion about Rust code being the only creator of rustls_str objects
227227
// changes, you must change this Debug impl, since the assertion in it no longer
228228
// holds.
229-
impl<'a> fmt::Debug for rustls_str<'a> {
229+
impl fmt::Debug for rustls_str<'_> {
230230
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
231231
let raw = unsafe {
232232
// Despite the use of "unsafe", we know that this is safe because:

0 commit comments

Comments
 (0)