thiserror, docs, remove general Failure case (#9741)

automerge
This commit is contained in:
anatoly yakovenko
2020-04-29 18:12:51 -07:00
committed by GitHub
parent 230df0ec0c
commit a0514eb2ae
8 changed files with 54 additions and 26 deletions

View File

@@ -161,7 +161,7 @@ pub struct PruneData {
impl Sanitize for PruneData {
fn sanitize(&self) -> std::result::Result<(), SanitizeError> {
if self.wallclock >= MAX_WALLCLOCK {
return Err(SanitizeError::ValueOutOfRange);
return Err(SanitizeError::ValueOutOfBounds);
}
Ok(())
}
@@ -2822,7 +2822,7 @@ mod tests {
let mut pd = PruneData::default();
pd.wallclock = MAX_WALLCLOCK;
let msg = Protocol::PruneMessage(Pubkey::default(), pd);
assert_eq!(msg.sanitize(), Err(SanitizeError::ValueOutOfRange));
assert_eq!(msg.sanitize(), Err(SanitizeError::ValueOutOfBounds));
}
// computes the maximum size for pull request blooms