mirror of
https://github.com/RGBCube/uutils-coreutils
synced 2025-07-28 11:37:44 +00:00
all: use array intoiterator
This commit is contained in:
parent
c6c936f529
commit
18369dc0be
33 changed files with 145 additions and 145 deletions
|
@ -70,12 +70,12 @@ fn test_2files() {
|
|||
let file1 = tmpdir.join("test1");
|
||||
let file2 = tmpdir.join("test2");
|
||||
|
||||
for &(n, a) in &[(1, "a"), (2, "b")] {
|
||||
for (n, a) in [(1, "a"), (2, "b")] {
|
||||
println!("number: {} letter:{}", n, a);
|
||||
}
|
||||
|
||||
// spell-checker:disable-next-line
|
||||
for &(path, data) in &[(&file1, "abcdefghijklmnop"), (&file2, "qrstuvwxyz\n")] {
|
||||
for (path, data) in [(&file1, "abcdefghijklmnop"), (&file2, "qrstuvwxyz\n")] {
|
||||
let mut f = File::create(&path).unwrap();
|
||||
assert!(
|
||||
f.write_all(data.as_bytes()).is_ok(),
|
||||
|
@ -127,7 +127,7 @@ fn test_from_mixed() {
|
|||
|
||||
// spell-checker:disable-next-line
|
||||
let (data1, data2, data3) = ("abcdefg", "hijklmnop", "qrstuvwxyz\n");
|
||||
for &(path, data) in &[(&file1, data1), (&file3, data3)] {
|
||||
for (path, data) in [(&file1, data1), (&file3, data3)] {
|
||||
let mut f = File::create(&path).unwrap();
|
||||
assert!(
|
||||
f.write_all(data.as_bytes()).is_ok(),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue