Skip to content

Commit 26b0f6a

Browse files
committed
clippy happy
1 parent dd677a9 commit 26b0f6a

File tree

6 files changed

+42
-25
lines changed

6 files changed

+42
-25
lines changed

datadog-profiling-otel/build.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ fn main() {
3535
// SPDX-License-Identifier: Apache-2.0
3636
3737
// This module is generated by prost-build from profiles.proto
38+
#[allow(clippy::all)]
3839
pub mod opentelemetry {
3940
pub mod proto {
4041
pub mod common {

datadog-profiling-otel/examples/basic_usage.rs

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -23,16 +23,20 @@ fn main() {
2323
};
2424

2525
// Create a profile
26-
let mut profile = Profile::default();
27-
profile.sample_type = Some(sample_type);
28-
profile.time_nanos = std::time::SystemTime::now()
29-
.duration_since(std::time::UNIX_EPOCH)
30-
.unwrap()
31-
.as_nanos() as i64;
26+
let profile = Profile {
27+
sample_type: Some(sample_type),
28+
time_nanos: std::time::SystemTime::now()
29+
.duration_since(std::time::UNIX_EPOCH)
30+
.unwrap()
31+
.as_nanos() as i64,
32+
..Default::default()
33+
};
3234

3335
// Create profiles data
34-
let mut profiles_data = ProfilesData::default();
35-
profiles_data.dictionary = Some(profiles_dict);
36+
let mut profiles_data = ProfilesData {
37+
dictionary: Some(profiles_dict),
38+
..Default::default()
39+
};
3640

3741
let mut scope_profiles = ScopeProfiles::default();
3842
scope_profiles.profiles.push(profile);

datadog-profiling-otel/src/lib.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,10 @@ mod tests {
2222
let mut profiles_dict = ProfilesDictionary::default();
2323
profiles_dict.string_table.push("test".to_string());
2424

25-
let mut profiles_data = ProfilesData::default();
26-
profiles_data.dictionary = Some(profiles_dict);
25+
let profiles_data = ProfilesData {
26+
dictionary: Some(profiles_dict),
27+
..Default::default()
28+
};
2729

2830
// Verify the data was set correctly
2931
assert_eq!(profiles_data.dictionary.as_ref().unwrap().string_table[0], "test");

datadog-profiling/src/internal/profile/otel_emitter/location.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ mod tests {
4747
assert_eq!(otel_location.line[0].function_index, 3);
4848
assert_eq!(otel_location.line[0].line, 42);
4949
assert_eq!(otel_location.line[0].column, 0);
50-
assert_eq!(otel_location.is_folded, false);
50+
assert!(!otel_location.is_folded);
5151
assert_eq!(otel_location.attribute_indices, vec![] as Vec<i32>);
5252
}
5353

datadog-profiling/src/internal/profile/otel_emitter/mapping.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -45,10 +45,10 @@ mod tests {
4545
assert_eq!(otel_mapping.file_offset, 0x100);
4646
assert_eq!(otel_mapping.filename_strindex, 42);
4747
assert_eq!(otel_mapping.attribute_indices, vec![] as Vec<i32>);
48-
assert_eq!(otel_mapping.has_functions, true);
49-
assert_eq!(otel_mapping.has_filenames, true);
50-
assert_eq!(otel_mapping.has_line_numbers, true);
51-
assert_eq!(otel_mapping.has_inline_frames, false);
48+
assert!(otel_mapping.has_functions);
49+
assert!(otel_mapping.has_filenames);
50+
assert!(otel_mapping.has_line_numbers);
51+
assert!(!otel_mapping.has_inline_frames);
5252
}
5353

5454
#[test]

datadog-trace-protobuf/src/remoteconfig.rs

Lines changed: 20 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,17 @@
33

44
use serde::{Deserialize, Serialize};
55
// This file is @generated by prost-build.
6-
#[derive(Deserialize, Serialize, Clone, PartialEq, ::prost::Message)]
6+
#[derive(Deserialize, Serialize)]
7+
#[derive(Clone, PartialEq, ::prost::Message)]
78
pub struct File {
89
#[prost(string, tag = "1")]
910
pub path: ::prost::alloc::string::String,
1011
#[prost(bytes = "vec", tag = "2")]
1112
#[serde(with = "serde_bytes")]
1213
pub raw: ::prost::alloc::vec::Vec<u8>,
1314
}
14-
#[derive(Deserialize, Serialize, Clone, PartialEq, ::prost::Message)]
15+
#[derive(Deserialize, Serialize)]
16+
#[derive(Clone, PartialEq, ::prost::Message)]
1517
pub struct Client {
1618
#[prost(message, optional, tag = "1")]
1719
pub state: ::core::option::Option<ClientState>,
@@ -33,7 +35,8 @@ pub struct Client {
3335
#[prost(bytes = "vec", tag = "11")]
3436
pub capabilities: ::prost::alloc::vec::Vec<u8>,
3537
}
36-
#[derive(Deserialize, Serialize, Clone, PartialEq, ::prost::Message)]
38+
#[derive(Deserialize, Serialize)]
39+
#[derive(Clone, PartialEq, ::prost::Message)]
3740
pub struct ClientTracer {
3841
#[prost(string, tag = "1")]
3942
pub runtime_id: ::prost::alloc::string::String,
@@ -52,7 +55,8 @@ pub struct ClientTracer {
5255
#[prost(string, repeated, tag = "7")]
5356
pub tags: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
5457
}
55-
#[derive(Deserialize, Serialize, Clone, PartialEq, ::prost::Message)]
58+
#[derive(Deserialize, Serialize)]
59+
#[derive(Clone, PartialEq, ::prost::Message)]
5660
pub struct ClientAgent {
5761
#[prost(string, tag = "1")]
5862
pub name: ::prost::alloc::string::String,
@@ -65,7 +69,8 @@ pub struct ClientAgent {
6569
#[prost(string, repeated, tag = "5")]
6670
pub cws_workloads: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
6771
}
68-
#[derive(Deserialize, Serialize, Clone, PartialEq, ::prost::Message)]
72+
#[derive(Deserialize, Serialize)]
73+
#[derive(Clone, PartialEq, ::prost::Message)]
6974
pub struct ConfigState {
7075
#[prost(string, tag = "1")]
7176
pub id: ::prost::alloc::string::String,
@@ -78,7 +83,8 @@ pub struct ConfigState {
7883
#[prost(string, tag = "5")]
7984
pub apply_error: ::prost::alloc::string::String,
8085
}
81-
#[derive(Deserialize, Serialize, Clone, PartialEq, ::prost::Message)]
86+
#[derive(Deserialize, Serialize)]
87+
#[derive(Clone, PartialEq, ::prost::Message)]
8288
pub struct ClientState {
8389
#[prost(uint64, tag = "1")]
8490
pub root_version: u64,
@@ -93,14 +99,16 @@ pub struct ClientState {
9399
#[prost(bytes = "vec", tag = "6")]
94100
pub backend_client_state: ::prost::alloc::vec::Vec<u8>,
95101
}
96-
#[derive(Deserialize, Serialize, Clone, PartialEq, ::prost::Message)]
102+
#[derive(Deserialize, Serialize)]
103+
#[derive(Clone, PartialEq, ::prost::Message)]
97104
pub struct TargetFileHash {
98105
#[prost(string, tag = "1")]
99106
pub algorithm: ::prost::alloc::string::String,
100107
#[prost(string, tag = "3")]
101108
pub hash: ::prost::alloc::string::String,
102109
}
103-
#[derive(Deserialize, Serialize, Clone, PartialEq, ::prost::Message)]
110+
#[derive(Deserialize, Serialize)]
111+
#[derive(Clone, PartialEq, ::prost::Message)]
104112
pub struct TargetFileMeta {
105113
#[prost(string, tag = "1")]
106114
pub path: ::prost::alloc::string::String,
@@ -109,14 +117,16 @@ pub struct TargetFileMeta {
109117
#[prost(message, repeated, tag = "3")]
110118
pub hashes: ::prost::alloc::vec::Vec<TargetFileHash>,
111119
}
112-
#[derive(Deserialize, Serialize, Clone, PartialEq, ::prost::Message)]
120+
#[derive(Deserialize, Serialize)]
121+
#[derive(Clone, PartialEq, ::prost::Message)]
113122
pub struct ClientGetConfigsRequest {
114123
#[prost(message, optional, tag = "1")]
115124
pub client: ::core::option::Option<Client>,
116125
#[prost(message, repeated, tag = "2")]
117126
pub cached_target_files: ::prost::alloc::vec::Vec<TargetFileMeta>,
118127
}
119-
#[derive(Deserialize, Serialize, Clone, PartialEq, ::prost::Message)]
128+
#[derive(Deserialize, Serialize)]
129+
#[derive(Clone, PartialEq, ::prost::Message)]
120130
pub struct ClientGetConfigsResponse {
121131
#[prost(bytes = "vec", repeated, tag = "1")]
122132
#[serde(with = "crate::serde")]

0 commit comments

Comments
 (0)