Skip to content

Commit 805d8c8

Browse files
committed
Tweak tests for references
1 parent cd578bc commit 805d8c8

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

tests/mod.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,8 @@ fn test_zip() {
156156
let a: GenericArray<_, U4> = GenericArray::generate(|i| i + 1);
157157
let b: GenericArray<_, U4> = GenericArray::generate(|i| i as i32 * 4);
158158

159-
let c = (&a).zip(&b, |r, l| *r as i32 + l);
159+
// Uses reference and non-reference arguments
160+
let c = (&a).zip(b, |r, l| *r as i32 + l);
160161

161162
assert_eq!(c, arr![i32; 1, 6, 11, 16]);
162163
}

tests/std.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,10 @@ use generic_array::functional::*;
1212

1313
pub fn test_generic<S>(s: S)
1414
where
15-
S: FunctionalSequence<i32>,
16-
SequenceItem<S>: Add<i32, Output=i32>,
17-
S: MappedGenericSequence<i32, i32>,
18-
MappedSequence<S, i32, i32>: Debug
15+
S: FunctionalSequence<i32>, // `.map`
16+
SequenceItem<S>: Add<i32, Output=i32>, // `+`
17+
S: MappedGenericSequence<i32, i32>, // `i32` -> `i32`
18+
MappedSequence<S, i32, i32>: Debug // println!
1919
{
2020
let a = s.map(|x| x + 1);
2121

0 commit comments

Comments
 (0)