Skip to content

Commit a57b91c

Browse files
ref: Fix new Clippy lints (#935)
Resolves #934 Resolves [RUST-124](https://linear.app/getsentry/issue/RUST-124/fix-lint-ci-job-failures)
1 parent 5759575 commit a57b91c

File tree

2 files changed

+4
-13
lines changed

2 files changed

+4
-13
lines changed

sentry-types/src/protocol/attachment.rs

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,11 @@ use std::fmt;
33
use serde::Deserialize;
44

55
/// The different types an attachment can have.
6-
#[derive(Debug, Clone, Eq, PartialEq, Deserialize)]
6+
#[derive(Debug, Clone, Eq, PartialEq, Deserialize, Default)]
77
pub enum AttachmentType {
88
#[serde(rename = "event.attachment")]
99
/// (default) A standard attachment without special meaning.
10+
#[default]
1011
Attachment,
1112
/// A minidump file that creates an error event and is symbolicated. The
1213
/// file should start with the `MDMP` magic bytes.
@@ -28,12 +29,6 @@ pub enum AttachmentType {
2829
Custom(String),
2930
}
3031

31-
impl Default for AttachmentType {
32-
fn default() -> Self {
33-
Self::Attachment
34-
}
35-
}
36-
3732
impl AttachmentType {
3833
/// Gets the string value Sentry expects for the attachment type.
3934
pub fn as_str(&self) -> &str {

sentry-types/src/protocol/session.rs

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,12 @@ use crate::utils::{ts_rfc3339, ts_rfc3339_opt};
1313
/// The Status of a Release Health Session.
1414
#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd, Deserialize, Serialize)]
1515
#[serde(rename_all = "snake_case")]
16+
#[derive(Default)]
1617
pub enum SessionStatus {
1718
/// The session is healthy.
1819
///
1920
/// This does not necessarily indicate that the session is still active.
21+
#[default]
2022
Ok,
2123
/// The session terminated normally.
2224
Exited,
@@ -26,12 +28,6 @@ pub enum SessionStatus {
2628
Abnormal,
2729
}
2830

29-
impl Default for SessionStatus {
30-
fn default() -> Self {
31-
Self::Ok
32-
}
33-
}
34-
3531
/// An error used when parsing `SessionStatus`.
3632
#[derive(Debug, Error)]
3733
#[error("invalid session status")]

0 commit comments

Comments
 (0)