Skip to content

Commit

Permalink
chore: support Noir 1 beta.1
Browse files Browse the repository at this point in the history
  • Loading branch information
olehmisar committed Jan 12, 2025
1 parent 2e73cce commit d2042f8
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 6 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
strategy:
fail-fast: false
matrix:
toolchain: [0.39.0, 1.0.0-beta.0]
toolchain: [0.39.0, 1.0.0-beta.0, 1.0.0-beta.1]
steps:
- name: Checkout sources
uses: actions/checkout@v4
Expand All @@ -38,7 +38,7 @@ jobs:
- name: Install Nargo
uses: noir-lang/[email protected]
with:
toolchain: 1.0.0-beta.0
toolchain: 1.0.0-beta.1

- name: Run formatter
run: nargo fmt --check
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Nodash is a utility library for [Noir](https://github.com/noir-lang/noir) langua
Put this into your Nargo.toml.

```toml
nodash = { git = "https://github.com/olehmisar/nodash/", tag = "v0.39.3" }
nodash = { git = "https://github.com/olehmisar/nodash/", tag = "v0.39.4" }
```

## Docs
Expand Down
1 change: 0 additions & 1 deletion src/math/numeric.nr
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
// TODO: remove this trait if it is implemented in Noir std lib.
pub(crate) trait Numeric {
fn zero() -> Self;
fn one() -> Self;
Expand Down
3 changes: 1 addition & 2 deletions src/math/sqrt.nr
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
use crate::math::numeric::Numeric;
use std::{cmp::Ord, ops::{Add, Div, Mul}};

// TODO: check if this is correct
pub fn sqrt<T>(value: T) -> T
where
T: Numeric + Mul + Ord + Add + Div,
{
let r = unsafe {
// Safety: unsafe sqrt is checked to be between bounds
//@safety: unsafe sqrt is checked to be between bounds
let r = sqrt_unconstrained(value);
assert(value >= r * r);
let ONE: T = Numeric::one();
Expand Down

0 comments on commit d2042f8

Please sign in to comment.