Skip to content

Commit a2bdeca

Browse files
Elide lifetimes where possible (#716)
1 parent 6de0bb6 commit a2bdeca

File tree

5 files changed

+14
-14
lines changed

5 files changed

+14
-14
lines changed

sentry-core/src/intodsn.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ impl IntoDsn for () {
2727
}
2828
}
2929

30-
impl<'a> IntoDsn for &'a str {
30+
impl IntoDsn for &'_ str {
3131
fn into_dsn(self) -> Result<Option<Dsn>, ParseDsnError> {
3232
if self.is_empty() {
3333
Ok(None)
@@ -37,14 +37,14 @@ impl<'a> IntoDsn for &'a str {
3737
}
3838
}
3939

40-
impl<'a> IntoDsn for Cow<'a, str> {
40+
impl IntoDsn for Cow<'_, str> {
4141
fn into_dsn(self) -> Result<Option<Dsn>, ParseDsnError> {
4242
let x: &str = &self;
4343
x.into_dsn()
4444
}
4545
}
4646

47-
impl<'a> IntoDsn for &'a OsStr {
47+
impl IntoDsn for &'_ OsStr {
4848
fn into_dsn(self) -> Result<Option<Dsn>, ParseDsnError> {
4949
self.to_string_lossy().into_dsn()
5050
}
@@ -62,7 +62,7 @@ impl IntoDsn for String {
6262
}
6363
}
6464

65-
impl<'a> IntoDsn for &'a Dsn {
65+
impl IntoDsn for &'_ Dsn {
6666
fn into_dsn(self) -> Result<Option<Dsn>, ParseDsnError> {
6767
Ok(Some(self.clone()))
6868
}

sentry-core/src/performance.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -751,7 +751,7 @@ impl Transaction {
751751
/// A smart pointer to a span's [`data` field](protocol::Span::data).
752752
pub struct Data<'a>(MutexGuard<'a, protocol::Span>);
753753

754-
impl<'a> Data<'a> {
754+
impl Data<'_> {
755755
/// Set some extra information to be sent with this Span.
756756
pub fn set_data(&mut self, key: String, value: protocol::Value) {
757757
self.0.data.insert(key, value);
@@ -763,15 +763,15 @@ impl<'a> Data<'a> {
763763
}
764764
}
765765

766-
impl<'a> Deref for Data<'a> {
766+
impl Deref for Data<'_> {
767767
type Target = BTreeMap<String, protocol::Value>;
768768

769769
fn deref(&self) -> &Self::Target {
770770
&self.0.data
771771
}
772772
}
773773

774-
impl<'a> DerefMut for Data<'a> {
774+
impl DerefMut for Data<'_> {
775775
fn deref_mut(&mut self) -> &mut Self::Target {
776776
&mut self.0.data
777777
}

sentry-slog/src/converters.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ macro_rules! impl_into {
2222
}
2323
};
2424
}
25-
impl<'a> Serializer for MapSerializer<'a> {
25+
impl Serializer for MapSerializer<'_> {
2626
fn emit_arguments(&mut self, key: Key, val: &fmt::Arguments) -> slog::Result {
2727
self.0.insert(key.into(), val.to_string().into());
2828
Ok(())

sentry-types/src/protocol/v7.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -1643,7 +1643,7 @@ pub struct Event<'a> {
16431643
pub sdk: Option<Cow<'a, ClientSdkInfo>>,
16441644
}
16451645

1646-
impl<'a> Default for Event<'a> {
1646+
impl Default for Event<'_> {
16471647
fn default() -> Self {
16481648
Event {
16491649
event_id: event::default_id(),
@@ -1722,7 +1722,7 @@ impl<'a> Event<'a> {
17221722
}
17231723
}
17241724

1725-
impl<'a> fmt::Display for Event<'a> {
1725+
impl fmt::Display for Event<'_> {
17261726
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
17271727
write!(
17281728
f,
@@ -1994,7 +1994,7 @@ pub struct Transaction<'a> {
19941994
pub server_name: Option<Cow<'a, str>>,
19951995
}
19961996

1997-
impl<'a> Default for Transaction<'a> {
1997+
impl Default for Transaction<'_> {
19981998
fn default() -> Self {
19991999
Transaction {
20002000
event_id: event::default_id(),
@@ -2049,7 +2049,7 @@ impl<'a> Transaction<'a> {
20492049
}
20502050
}
20512051

2052-
impl<'a> fmt::Display for Transaction<'a> {
2052+
impl fmt::Display for Transaction<'_> {
20532053
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
20542054
write!(
20552055
f,

sentry-types/src/utils.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ pub mod ts_seconds_float {
6060

6161
struct SecondsTimestampVisitor;
6262

63-
impl<'de> de::Visitor<'de> for SecondsTimestampVisitor {
63+
impl de::Visitor<'_> for SecondsTimestampVisitor {
6464
type Value = SystemTime;
6565

6666
fn expecting(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
@@ -144,7 +144,7 @@ pub mod ts_rfc3339 {
144144

145145
pub(super) struct Rfc3339Deserializer;
146146

147-
impl<'de> de::Visitor<'de> for Rfc3339Deserializer {
147+
impl de::Visitor<'_> for Rfc3339Deserializer {
148148
type Value = SystemTime;
149149

150150
fn expecting(&self, formatter: &mut fmt::Formatter) -> fmt::Result {

0 commit comments

Comments
 (0)