summaryrefslogtreecommitdiffstats
path: root/src/tools/rustfmt/tests/target/spaces-around-ranges.rs
blob: b53e5b58b8cd62c9359f757ec43dfb2c0a703bee (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
// rustfmt-spaces_around_ranges: true

fn bar(v: &[u8]) {}

fn foo() {
    let a = vec![0; 20];
    for j in 0 ..= 20 {
        for i in 0 .. 3 {
            bar(a[i .. j]);
            bar(a[i ..]);
            bar(a[.. j]);
            bar(a[..= (j + 1)]);
        }
    }
}