Skip the vec! macro to create an empty vector
This commit is contained in:
@@ -115,7 +115,7 @@ pub mod v1 {
|
|||||||
for (position, properties) in v {
|
for (position, properties) in v {
|
||||||
hashmap
|
hashmap
|
||||||
.entry(properties)
|
.entry(properties)
|
||||||
.or_insert_with(|| vec![])
|
.or_insert_with(Vec::new)
|
||||||
.push((space, position));
|
.push((space, position));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -226,7 +226,7 @@ pub mod v2 {
|
|||||||
.entry(properties)
|
.entry(properties)
|
||||||
.or_insert_with(HashMap::new)
|
.or_insert_with(HashMap::new)
|
||||||
.entry(space)
|
.entry(space)
|
||||||
.or_insert_with(|| vec![])
|
.or_insert_with(Vec::new)
|
||||||
.push(position.into());
|
.push(position.into());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -180,9 +180,7 @@ fn convert(string: &str) -> Result<Vec<SpatialObject>, Error> {
|
|||||||
let (x, y, z) = (x - origin[0], y - origin[1], z - origin[2]);
|
let (x, y, z) = (x - origin[0], y - origin[1], z - origin[2]);
|
||||||
let (x, y, z) = (x * 0.039_062_5, y * 0.039_062_5, z * 0.039_062_5);
|
let (x, y, z) = (x * 0.039_062_5, y * 0.039_062_5, z * 0.039_062_5);
|
||||||
|
|
||||||
oids.entry(oid)
|
oids.entry(oid).or_insert_with(Vec::new).push(vec![x, y, z]);
|
||||||
.or_insert_with(|| vec![])
|
|
||||||
.push(vec![x, y, z]);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
_ => trace!("line {:?}, values: {:?}", line, values),
|
_ => trace!("line {:?}, values: {:?}", line, values),
|
||||||
|
|||||||
Reference in New Issue
Block a user