Skip to content

Commit 5c4b678

Browse files
anakrishCopilot
andcommitted
style: cargo fmt
Apply rustfmt over the storage-abstraction patch series. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent 0059daf commit 5c4b678

3 files changed

Lines changed: 4 additions & 15 deletions

File tree

src/collections/tests.rs

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -251,10 +251,7 @@ fn set_value_cow_make_mut_isolates_clones() {
251251
let a = Value::new_set();
252252
let b = a.clone();
253253
let mut b_owned = b;
254-
b_owned
255-
.as_set_mut()
256-
.expect("set")
257-
.insert(Value::from("x"));
254+
b_owned.as_set_mut().expect("set").insert(Value::from("x"));
258255
assert_eq!(a.as_set().expect("set").len(), 0);
259256
assert_eq!(b_owned.as_set().expect("set").len(), 1);
260257
}
@@ -339,10 +336,7 @@ fn object_accessor_coverage() {
339336
assert_eq!(keys_sorted.len(), 4);
340337
assert_eq!(keys_sorted[0], &val(0));
341338

342-
let values_sum: u64 = obj
343-
.values()
344-
.map(|v| v.as_u64().unwrap_or(0))
345-
.sum();
339+
let values_sum: u64 = obj.values().map(|v| v.as_u64().unwrap_or(0)).sum();
346340
// 0 + 2 + 999 + 6 = 1007
347341
assert_eq!(values_sum, 1007);
348342

src/rvm/vm/context.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -145,9 +145,7 @@ mod tests {
145145
assert!(collected.contains(&(Value::from("a"), Value::from(1))));
146146
assert!(collected.contains(&(Value::from("b"), Value::from(2))));
147147
assert!(collected.contains(&(Value::from("c"), Value::from(3))));
148-
assert!(!collected
149-
.iter()
150-
.any(|(k, _)| k == &Value::from("d")));
148+
assert!(!collected.iter().any(|(k, _)| k == &Value::from("d")));
151149

152150
// The original source Value (untouched) is also unchanged.
153151
let src_obj = source.as_object().expect("object");

src/rvm/vm/loops.rs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -509,10 +509,7 @@ impl RegoVM {
509509
Ok(false)
510510
}
511511
}
512-
IterationState::Object {
513-
ref pairs,
514-
ref pos,
515-
} => {
512+
IterationState::Object { ref pairs, ref pos } => {
516513
if let Some((key, value)) = pairs.get(*pos) {
517514
if key_reg != value_reg {
518515
self.set_register(key_reg, key.clone())?;

0 commit comments

Comments
 (0)