Skip to content

Commit

Permalink
chore: replace strict equalities in documentation of sort_via
Browse files Browse the repository at this point in the history
  • Loading branch information
TomAFrench committed Sep 11, 2024
1 parent 44d2caf commit a329123
Show file tree
Hide file tree
Showing 20 changed files with 39 additions and 39 deletions.
4 changes: 2 additions & 2 deletions docs/docs/noir/concepts/data_types/arrays.md
Original file line number Diff line number Diff line change
Expand Up @@ -141,10 +141,10 @@ example
```rust
fn main() {
let arr = [42, 32]
let sorted_ascending = arr.sort_via(|a, b| a < b);
let sorted_ascending = arr.sort_via(|a, b| a <= b);
assert(sorted_ascending == [32, 42]); // verifies

let sorted_descending = arr.sort_via(|a, b| a > b);
let sorted_descending = arr.sort_via(|a, b| a >= b);
assert(sorted_descending == [32, 42]); // does not verify
}
```
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -130,10 +130,10 @@ example
```rust
fn main() {
let arr = [42, 32]
let sorted_ascending = arr.sort_via(|a, b| a < b);
let sorted_ascending = arr.sort_via(|a, b| a <= b);
assert(sorted_ascending == [32, 42]); // verifies

let sorted_descending = arr.sort_via(|a, b| a > b);
let sorted_descending = arr.sort_via(|a, b| a >= b);
assert(sorted_descending == [32, 42]); // does not verify
}
```
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -130,10 +130,10 @@ example
```rust
fn main() {
let arr = [42, 32]
let sorted_ascending = arr.sort_via(|a, b| a < b);
let sorted_ascending = arr.sort_via(|a, b| a <= b);
assert(sorted_ascending == [32, 42]); // verifies

let sorted_descending = arr.sort_via(|a, b| a > b);
let sorted_descending = arr.sort_via(|a, b| a >= b);
assert(sorted_descending == [32, 42]); // does not verify
}
```
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -130,10 +130,10 @@ example
```rust
fn main() {
let arr = [42, 32]
let sorted_ascending = arr.sort_via(|a, b| a < b);
let sorted_ascending = arr.sort_via(|a, b| a <= b);
assert(sorted_ascending == [32, 42]); // verifies

let sorted_descending = arr.sort_via(|a, b| a > b);
let sorted_descending = arr.sort_via(|a, b| a >= b);
assert(sorted_descending == [32, 42]); // does not verify
}
```
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -130,10 +130,10 @@ example
```rust
fn main() {
let arr = [42, 32]
let sorted_ascending = arr.sort_via(|a, b| a < b);
let sorted_ascending = arr.sort_via(|a, b| a <= b);
assert(sorted_ascending == [32, 42]); // verifies

let sorted_descending = arr.sort_via(|a, b| a > b);
let sorted_descending = arr.sort_via(|a, b| a >= b);
assert(sorted_descending == [32, 42]); // does not verify
}
```
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -130,10 +130,10 @@ example
```rust
fn main() {
let arr = [42, 32]
let sorted_ascending = arr.sort_via(|a, b| a < b);
let sorted_ascending = arr.sort_via(|a, b| a <= b);
assert(sorted_ascending == [32, 42]); // verifies

let sorted_descending = arr.sort_via(|a, b| a > b);
let sorted_descending = arr.sort_via(|a, b| a >= b);
assert(sorted_descending == [32, 42]); // does not verify
}
```
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -130,10 +130,10 @@ example
```rust
fn main() {
let arr = [42, 32]
let sorted_ascending = arr.sort_via(|a, b| a < b);
let sorted_ascending = arr.sort_via(|a, b| a <= b);
assert(sorted_ascending == [32, 42]); // verifies

let sorted_descending = arr.sort_via(|a, b| a > b);
let sorted_descending = arr.sort_via(|a, b| a >= b);
assert(sorted_descending == [32, 42]); // does not verify
}
```
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -131,10 +131,10 @@ example
```rust
fn main() {
let arr = [42, 32]
let sorted_ascending = arr.sort_via(|a, b| a < b);
let sorted_ascending = arr.sort_via(|a, b| a <= b);
assert(sorted_ascending == [32, 42]); // verifies

let sorted_descending = arr.sort_via(|a, b| a > b);
let sorted_descending = arr.sort_via(|a, b| a >= b);
assert(sorted_descending == [32, 42]); // does not verify
}
```
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -137,10 +137,10 @@ example
```rust
fn main() {
let arr = [42, 32]
let sorted_ascending = arr.sort_via(|a, b| a < b);
let sorted_ascending = arr.sort_via(|a, b| a <= b);
assert(sorted_ascending == [32, 42]); // verifies

let sorted_descending = arr.sort_via(|a, b| a > b);
let sorted_descending = arr.sort_via(|a, b| a >= b);
assert(sorted_descending == [32, 42]); // does not verify
}
```
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -139,10 +139,10 @@ example
```rust
fn main() {
let arr = [42, 32]
let sorted_ascending = arr.sort_via(|a, b| a < b);
let sorted_ascending = arr.sort_via(|a, b| a <= b);
assert(sorted_ascending == [32, 42]); // verifies

let sorted_descending = arr.sort_via(|a, b| a > b);
let sorted_descending = arr.sort_via(|a, b| a >= b);
assert(sorted_descending == [32, 42]); // does not verify
}
```
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -139,10 +139,10 @@ example
```rust
fn main() {
let arr = [42, 32]
let sorted_ascending = arr.sort_via(|a, b| a < b);
let sorted_ascending = arr.sort_via(|a, b| a <= b);
assert(sorted_ascending == [32, 42]); // verifies

let sorted_descending = arr.sort_via(|a, b| a > b);
let sorted_descending = arr.sort_via(|a, b| a >= b);
assert(sorted_descending == [32, 42]); // does not verify
}
```
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -139,10 +139,10 @@ example
```rust
fn main() {
let arr = [42, 32]
let sorted_ascending = arr.sort_via(|a, b| a < b);
let sorted_ascending = arr.sort_via(|a, b| a <= b);
assert(sorted_ascending == [32, 42]); // verifies

let sorted_descending = arr.sort_via(|a, b| a > b);
let sorted_descending = arr.sort_via(|a, b| a >= b);
assert(sorted_descending == [32, 42]); // does not verify
}
```
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -139,10 +139,10 @@ example
```rust
fn main() {
let arr = [42, 32]
let sorted_ascending = arr.sort_via(|a, b| a < b);
let sorted_ascending = arr.sort_via(|a, b| a <= b);
assert(sorted_ascending == [32, 42]); // verifies

let sorted_descending = arr.sort_via(|a, b| a > b);
let sorted_descending = arr.sort_via(|a, b| a >= b);
assert(sorted_descending == [32, 42]); // does not verify
}
```
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -139,10 +139,10 @@ example
```rust
fn main() {
let arr = [42, 32]
let sorted_ascending = arr.sort_via(|a, b| a < b);
let sorted_ascending = arr.sort_via(|a, b| a <= b);
assert(sorted_ascending == [32, 42]); // verifies

let sorted_descending = arr.sort_via(|a, b| a > b);
let sorted_descending = arr.sort_via(|a, b| a >= b);
assert(sorted_descending == [32, 42]); // does not verify
}
```
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -139,10 +139,10 @@ example
```rust
fn main() {
let arr = [42, 32]
let sorted_ascending = arr.sort_via(|a, b| a < b);
let sorted_ascending = arr.sort_via(|a, b| a <= b);
assert(sorted_ascending == [32, 42]); // verifies

let sorted_descending = arr.sort_via(|a, b| a > b);
let sorted_descending = arr.sort_via(|a, b| a >= b);
assert(sorted_descending == [32, 42]); // does not verify
}
```
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -139,10 +139,10 @@ example
```rust
fn main() {
let arr = [42, 32]
let sorted_ascending = arr.sort_via(|a, b| a < b);
let sorted_ascending = arr.sort_via(|a, b| a <= b);
assert(sorted_ascending == [32, 42]); // verifies

let sorted_descending = arr.sort_via(|a, b| a > b);
let sorted_descending = arr.sort_via(|a, b| a >= b);
assert(sorted_descending == [32, 42]); // does not verify
}
```
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -139,10 +139,10 @@ example
```rust
fn main() {
let arr = [42, 32]
let sorted_ascending = arr.sort_via(|a, b| a < b);
let sorted_ascending = arr.sort_via(|a, b| a <= b);
assert(sorted_ascending == [32, 42]); // verifies

let sorted_descending = arr.sort_via(|a, b| a > b);
let sorted_descending = arr.sort_via(|a, b| a >= b);
assert(sorted_descending == [32, 42]); // does not verify
}
```
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -139,10 +139,10 @@ example
```rust
fn main() {
let arr = [42, 32]
let sorted_ascending = arr.sort_via(|a, b| a < b);
let sorted_ascending = arr.sort_via(|a, b| a <= b);
assert(sorted_ascending == [32, 42]); // verifies

let sorted_descending = arr.sort_via(|a, b| a > b);
let sorted_descending = arr.sort_via(|a, b| a >= b);
assert(sorted_descending == [32, 42]); // does not verify
}
```
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -139,10 +139,10 @@ example
```rust
fn main() {
let arr = [42, 32]
let sorted_ascending = arr.sort_via(|a, b| a < b);
let sorted_ascending = arr.sort_via(|a, b| a <= b);
assert(sorted_ascending == [32, 42]); // verifies

let sorted_descending = arr.sort_via(|a, b| a > b);
let sorted_descending = arr.sort_via(|a, b| a >= b);
assert(sorted_descending == [32, 42]); // does not verify
}
```
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ fn test_array_functions() {
//
// opened #2121 for it
// https://github.com/noir-lang/noir/issues/2121
// let descending = myarray.sort_via(|a, b| a > b);
// let descending = myarray.sort_via(|a, b| a >= b);
// assert(descending == [3, 2, 1]);
assert(evens.map(|n| n / 2) == myarray);
assert(evens.map(|n| n / two) == myarray);
Expand Down

0 comments on commit a329123

Please sign in to comment.