-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Checks against incorrect initialisation of the initial Indices. Incorrect initialisation could result in out of bounds behaviour when running the bisector in release mode. In debug mode, Indices::from_bisector will panic instead.
- Loading branch information
1 parent
0c92de0
commit b77e615
Showing
3 changed files
with
73 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
use std::fmt::{Debug, Display, Formatter}; | ||
|
||
#[derive(Debug, Eq, PartialEq)] | ||
pub struct EmptySliceError; | ||
|
||
impl Display for EmptySliceError { | ||
fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result { | ||
f.write_fmt(format_args!( | ||
"Expected a non-empty slice, but the given slice was empty (len = 0)" | ||
)) | ||
} | ||
} | ||
|
||
impl std::error::Error for EmptySliceError {} |
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