Skip to content

Commit e753dad

Browse files
committed
Clippy
1 parent 9e55d5f commit e753dad

File tree

2 files changed

+5
-32
lines changed

2 files changed

+5
-32
lines changed

datadog-crashtracker/src/crash_info/errors_intake.rs

Lines changed: 3 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ const AGENT_ERRORS_INTAKE_URL_PATH: &str = "/evp_proxy/v4/api/v2/errorsintake";
2222
const DEFAULT_AGENT_HOST: &str = "localhost";
2323
const DEFAULT_AGENT_PORT: u16 = 8126;
2424

25-
#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)]
25+
#[derive(Clone, Debug, Default, serde::Serialize, serde::Deserialize)]
2626
pub struct ErrorsIntakeConfig {
2727
/// Endpoint to send the data to
2828
/// This is private and should be interacted with through the set_endpoint function
@@ -56,7 +56,7 @@ fn endpoint_with_errors_intake_path(
5656
}
5757

5858
/// Settings gathers configuration options we receive from the environment
59-
#[derive(Debug)]
59+
#[derive(Debug, Default)]
6060
pub struct ErrorsIntakeSettings {
6161
// Env parameter
6262
pub agent_host: Option<String>,
@@ -73,24 +73,6 @@ pub struct ErrorsIntakeSettings {
7373
pub agent_uds_socket_found: bool,
7474
}
7575

76-
impl Default for ErrorsIntakeSettings {
77-
fn default() -> Self {
78-
Self {
79-
agent_host: None,
80-
trace_agent_port: None,
81-
trace_agent_url: None,
82-
trace_pipe_name: None,
83-
direct_submission_enabled: false,
84-
api_key: None,
85-
site: None,
86-
errors_intake_dd_url: None,
87-
shared_lib_debug: false,
88-
89-
agent_uds_socket_found: false,
90-
}
91-
}
92-
}
93-
9476
impl ErrorsIntakeSettings {
9577
// Agent connection configuration
9678
const DD_TRACE_AGENT_URL: &'static str = "DD_TRACE_AGENT_URL";
@@ -133,16 +115,6 @@ impl ErrorsIntakeSettings {
133115
}
134116
}
135117

136-
impl Default for ErrorsIntakeConfig {
137-
fn default() -> Self {
138-
Self {
139-
endpoint: None,
140-
direct_submission_enabled: false,
141-
debug_enabled: false,
142-
}
143-
}
144-
}
145-
146118
impl ErrorsIntakeConfig {
147119
// Implemented following same pattern as telemetry
148120
fn trace_agent_url_from_setting(settings: &ErrorsIntakeSettings) -> String {
@@ -178,7 +150,7 @@ impl ErrorsIntakeConfig {
178150
#[cfg(unix)]
179151
return settings
180152
.agent_uds_socket_found
181-
.then(|| format!("unix:///var/run/datadog/apm.socket"));
153+
.then(|| "unix:///var/run/datadog/apm.socket".to_string());
182154
#[cfg(not(unix))]
183155
return None;
184156
})

datadog-crashtracker/src/crash_info/telemetry.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,8 @@ impl TelemetryCrashUploader {
152152
match ErrorsIntakeUploader::new(crashtracker_metadata, endpoint) {
153153
Ok(uploader) => Some(uploader),
154154
Err(e) => {
155-
panic!("Failed to create errors intake uploader: {e}");
155+
eprintln!("Failed to create errors intake uploader: {e}");
156+
None
156157
}
157158
};
158159

0 commit comments

Comments
 (0)