MCPcopy Create free account
hub / github.com/GitoxideLabs/learning-rust-with-gitoxide / add_one

Method add_one

errors/src/main.rs:28–30  ·  view source on GitHub ↗
(&self)

Source from the content-addressed store, hash-verified

26
27impl<'a> Adder<'a> {
28 fn add_one(&self) -> Result<i8, OutOfBoundsError> {
29 self.0.checked_add(1).ok_or(OutOfBoundsError::Overflow)
30 }
31
32 fn sub_one(&self) -> Result<i8, OutOfBoundsError> {
33 self.0.checked_sub(1).ok_or(OutOfBoundsError::Underflow)

Callers 1

do_itFunction · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected