Skip to content

Commit e9c86f8

Browse files
committed
No need to clone timestamps
1 parent f2733fc commit e9c86f8

File tree

4 files changed

+4
-6
lines changed

4 files changed

+4
-6
lines changed

src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@ pub fn store(args: TokenStream, item: TokenStream) -> TokenStream {
161161
}
162162
};
163163
decompressed_fields.push(quote! {
164-
#ident: #value.clone(),
164+
#ident: #value,
165165
});
166166
} else if round_float_field {
167167
decompressed_fields.push(quote! {

tests/expand/query_stats.expanded.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,7 @@ impl CompressedQueryStats {
174174
let row = QueryStat {
175175
database_id: self.database_id.clone(),
176176
collected_at: std::time::SystemTime::UNIX_EPOCH
177-
+ std::time::Duration::from_micros(collected_at[index]).clone(),
177+
+ std::time::Duration::from_micros(collected_at[index]),
178178
collected_secs: collected_secs.get(index).cloned().unwrap_or_default(),
179179
fingerprint: fingerprint.get(index).cloned().unwrap_or_default(),
180180
postgres_role_id: postgres_role_id

tests/expand/query_stats_chrono.expanded.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -176,8 +176,7 @@ impl CompressedQueryStats {
176176
collected_at: chrono::DateTime::from_timestamp_micros(
177177
collected_at[index] as i64,
178178
)
179-
.unwrap()
180-
.clone(),
179+
.unwrap(),
181180
collected_secs: collected_secs.get(index).cloned().unwrap_or_default(),
182181
fingerprint: fingerprint.get(index).cloned().unwrap_or_default(),
183182
postgres_role_id: postgres_role_id

tests/expand/system_storage_stats.expanded.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -168,8 +168,7 @@ impl CompressedSystemStorageStats {
168168
collected_at: chrono::DateTime::from_timestamp_micros(
169169
collected_at[index] as i64,
170170
)
171-
.unwrap()
172-
.clone(),
171+
.unwrap(),
173172
bytes_available: bytes_available.get(index).cloned().unwrap_or_default(),
174173
bytes_total: bytes_total.get(index).cloned().unwrap_or_default(),
175174
queue_depth: queue_depth.get(index).cloned().unwrap_or_default(),

0 commit comments

Comments
 (0)