bisector 1.0.0

Flexible bisect implementatation which allows the use the bisection method on arbitrary data types
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
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 {}