bump_local/error.rs
1use std::fmt;
2
3/// Reset is only allowed when single Bump reference exists
4pub struct ResetError;
5
6impl std::error::Error for ResetError {}
7
8impl fmt::Display for ResetError {
9 fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
10 f.write_str("reset is only allowed when single Bump reference exists")
11 }
12}
13
14impl fmt::Debug for ResetError {
15 fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
16 <Self as fmt::Display>::fmt(self, f)
17 }
18}