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

automerge
This commit is contained in:
mergify[bot]
2020-04-30 10:23:54 -07:00
committed by GitHub
parent 892abd2a24
commit 7a6543eb5b
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