-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Replaces most cases where this crate can panic with functions that return Result.
- Loading branch information
1 parent
4cbf85b
commit 762ec99
Showing
43 changed files
with
578 additions
and
400 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,11 @@ | ||
extern crate ndhistogram; | ||
use ndhistogram::axis::Uniform; | ||
use ndhistogram::{ndhistogram, Histogram}; | ||
use ndhistogram::{ndhistogram, Error, Histogram}; | ||
|
||
fn main() { | ||
let mut hist = ndhistogram!(Uniform::new(10, 0.0, 1.0)); | ||
fn main() -> Result<(), Error> { | ||
let mut hist = ndhistogram!(Uniform::new(10, 0.0, 1.0)?); | ||
|
||
// fill a single number | ||
hist.fill(&0.0); | ||
Ok(()) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,11 @@ | ||
extern crate ndhistogram; | ||
use ndhistogram::axis::Uniform; | ||
use ndhistogram::{ndhistogram, Histogram}; | ||
use ndhistogram::{ndhistogram, Error, Histogram}; | ||
|
||
fn main() { | ||
let mut hist = ndhistogram!(Uniform::new(10, 0.0, 1.0), Uniform::new(10, 1.0, 2.0)); | ||
fn main() -> Result<(), Error> { | ||
let mut hist = ndhistogram!(Uniform::new(10, 0.0, 1.0)?, Uniform::new(10, 1.0, 2.0)?); | ||
|
||
// fill a single number | ||
hist.fill(&(0.0, 1.0)); | ||
Ok(()) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.