fix: Remove redundant clones in tests
As suggested by the redundant_clone clippy lint. This is a little weird because different constructions of `points` now need clones in different places, but rustc will tell us when we need to clone and clippy will tell us when we don't.pull/24376/head
parent
196b364a00
commit
c7a7dde51f
|
@ -52,7 +52,7 @@ pub mod tests {
|
|||
let p2 = PointType::new_i64("two".to_string(), 23, 40);
|
||||
let p3 = PointType::new_i64("three".to_string(), 33, 86);
|
||||
|
||||
let mut points = vec![p1.clone(), p2.clone()];
|
||||
let mut points = vec![p1.clone(), p2];
|
||||
index
|
||||
.get_or_create_series_ids_for_points(bucket_id, &mut points)
|
||||
.unwrap();
|
||||
|
@ -67,7 +67,7 @@ pub mod tests {
|
|||
assert_eq!(points[0].series_id(), Some(1));
|
||||
|
||||
// now insert a new series in the first bucket and make sure it shows up
|
||||
let mut points = vec![p1.clone(), p3.clone()];
|
||||
let mut points = vec![p1, p3];
|
||||
index
|
||||
.get_or_create_series_ids_for_points(bucket_id, &mut points)
|
||||
.unwrap();
|
||||
|
@ -82,7 +82,7 @@ pub mod tests {
|
|||
let p3 = PointType::new_i64("cpu,host=a,region=west\tusage_user".to_string(), 1, 0);
|
||||
let p4 = PointType::new_i64("mem,host=b,region=west\tfree".to_string(), 1, 0);
|
||||
|
||||
let mut points = vec![p1.clone(), p2.clone(), p3.clone(), p4.clone()];
|
||||
let mut points = vec![p1, p2, p3, p4];
|
||||
index
|
||||
.get_or_create_series_ids_for_points(bucket_id, &mut points)
|
||||
.unwrap();
|
||||
|
|
|
@ -1270,7 +1270,7 @@ mod tests {
|
|||
db.insert_series_without_ids(b.id, &mut points);
|
||||
assert_eq!(points[0].series_id(), Some(4));
|
||||
|
||||
let mut points = vec![p1.clone(), p2.clone(), p3.clone(), p4.clone()];
|
||||
let mut points = vec![p1.clone(), p2.clone(), p3.clone(), p4];
|
||||
db.get_series_ids(b.id, &mut points).unwrap();
|
||||
assert_eq!(points[0].series_id(), Some(1));
|
||||
assert_eq!(points[1].series_id(), Some(2));
|
||||
|
@ -1282,7 +1282,7 @@ mod tests {
|
|||
db.insert_series_without_ids(b2.id, &mut points);
|
||||
assert_eq!(points[0].series_id(), Some(2));
|
||||
|
||||
let mut points = vec![p1.clone(), p2.clone(), p3.clone()];
|
||||
let mut points = vec![p1, p2, p3];
|
||||
db.get_series_ids(b2.id, &mut points).unwrap();
|
||||
assert_eq!(points[0].series_id(), Some(1));
|
||||
assert_eq!(points[1].series_id(), Some(2));
|
||||
|
@ -1302,7 +1302,7 @@ mod tests {
|
|||
bucket.id = db
|
||||
.create_bucket_if_not_exists(bucket.org_id, &bucket)
|
||||
.unwrap();
|
||||
let mut points = vec![p1.clone(), p2.clone(), p3.clone(), p4.clone()];
|
||||
let mut points = vec![p1, p2, p3, p4];
|
||||
db.get_or_create_series_ids_for_points(bucket.id, &mut points)
|
||||
.unwrap();
|
||||
|
||||
|
@ -1423,7 +1423,7 @@ mod tests {
|
|||
|
||||
b1.id = db.create_bucket_if_not_exists(b1.org_id, &b1).unwrap();
|
||||
|
||||
let mut points = vec![p1.clone()];
|
||||
let mut points = vec![p1];
|
||||
db.get_or_create_series_ids_for_points(b1.id, &mut points)
|
||||
.unwrap();
|
||||
db.write_points(b1.id, &points).unwrap();
|
||||
|
@ -1471,7 +1471,7 @@ mod tests {
|
|||
.unwrap();
|
||||
db.write_points(b1.id, &b1_points).unwrap();
|
||||
|
||||
let mut b2_points = vec![p1.clone(), p2.clone(), p3.clone(), p4.clone()];
|
||||
let mut b2_points = vec![p1, p2, p3, p4];
|
||||
db.get_or_create_series_ids_for_points(b2.id, &mut b2_points)
|
||||
.unwrap();
|
||||
db.write_points(b2.id, &b2_points).unwrap();
|
||||
|
@ -1620,7 +1620,7 @@ mod tests {
|
|||
|
||||
b1.id = db.create_bucket_if_not_exists(b1.org_id, &b1).unwrap();
|
||||
|
||||
let mut points = vec![p1.clone(), p2.clone()];
|
||||
let mut points = vec![p1, p2];
|
||||
db.get_or_create_series_ids_for_points(b1.id, &mut points)
|
||||
.unwrap();
|
||||
db.write_points_with_series_ids(b1.id, &points).unwrap();
|
||||
|
|
|
@ -55,7 +55,7 @@ pub mod tests {
|
|||
.write_points_with_series_ids(b1_id, &b1_points)
|
||||
.unwrap();
|
||||
|
||||
let b2_points = vec![p1.clone(), p2.clone(), p3.clone(), p4.clone()];
|
||||
let b2_points = vec![p1.clone(), p2, p3.clone(), p4];
|
||||
store
|
||||
.write_points_with_series_ids(b2_id, &b2_points)
|
||||
.unwrap();
|
||||
|
@ -132,7 +132,7 @@ pub mod tests {
|
|||
let mut p2 = PointType::new_f64("cpu,host=b,region=west\tusage_system".to_string(), 2.2, 2);
|
||||
p2.set_series_id(1);
|
||||
|
||||
let points = vec![p1.clone(), p2.clone()];
|
||||
let points = vec![p1.clone(), p2];
|
||||
store
|
||||
.write_points_with_series_ids(bucket_id, &points)
|
||||
.unwrap();
|
||||
|
|
Loading…
Reference in New Issue