Skip to content

Commit

Permalink
cargo fmt
Browse files Browse the repository at this point in the history
  • Loading branch information
droundy committed Jul 20, 2024
1 parent 7bb282b commit 0d6e80b
Show file tree
Hide file tree
Showing 4 changed files with 168 additions and 176 deletions.
10 changes: 5 additions & 5 deletions examples/array_refs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@
extern crate arrayref;

fn main() {
let x = [0,1,2,3,4,5,6,7,8,9];
let (a,b,c) = array_refs!(&x, 2, 3, 5);
let x = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9];
let (a, b, c) = array_refs!(&x, 2, 3, 5);
assert_eq!(2, a.len());
assert_eq!(3, b.len());
assert_eq!(5, c.len());
assert_eq!(*a, [0,1]);
assert_eq!(*b, [2,3,4]);
assert_eq!(*c, [5,6,7,8,9]);
assert_eq!(*a, [0, 1]);
assert_eq!(*b, [2, 3, 4]);
assert_eq!(*c, [5, 6, 7, 8, 9]);
}
10 changes: 5 additions & 5 deletions examples/array_refs_with_const.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@ const SIZE_B: usize = 3;
const SIZE_C: usize = 5;

fn main() {
let x: [u8; SIZE] = [0,1,2,3,4,5,6,7,8,9];
let (a,b,c) = array_refs!(&x, SIZE_A, SIZE_B, SIZE_C);
let x: [u8; SIZE] = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9];
let (a, b, c) = array_refs!(&x, SIZE_A, SIZE_B, SIZE_C);
assert_eq!(SIZE_A, a.len());
assert_eq!(SIZE_B, b.len());
assert_eq!(SIZE_C, c.len());
assert_eq!(*a, [0,1]);
assert_eq!(*b, [2,3,4]);
assert_eq!(*c, [5,6,7,8,9]);
assert_eq!(*a, [0, 1]);
assert_eq!(*b, [2, 3, 4]);
assert_eq!(*c, [5, 6, 7, 8, 9]);
}
2 changes: 1 addition & 1 deletion examples/simple-case.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,6 @@ fn main() {
x[20] = 1;
x[21] = 4;
x[24] = 3;
x[0] = add_three(array_mut_ref![x,20,3]);
x[0] = add_three(array_mut_ref![x, 20, 3]);
assert_eq!(x[0], 8);
}
Loading

0 comments on commit 0d6e80b

Please sign in to comment.