mirror of
https://github.com/chatmail/core.git
synced 2026-04-21 15:36:30 +03:00
Convert BlobError into an enum
This deletes a lot of code and complexity. Though comes at some cost: - The type no longer fits in a register and will always be on the stack. - Constructing the errors is more verbose, no more auto Into casting.
This commit is contained in:
committed by
Floris Bruynooghe
parent
084a87ed61
commit
74a4691f29
@@ -321,7 +321,6 @@ mod tests {
|
||||
use std::fs;
|
||||
use std::path::Path;
|
||||
|
||||
use crate::blob::BlobErrorKind;
|
||||
use crate::test_utils::*;
|
||||
|
||||
#[test]
|
||||
@@ -404,7 +403,10 @@ mod tests {
|
||||
|
||||
// Blob does not exist yet, expect BlobError.
|
||||
let err = p.get_blob(Param::File, &t.ctx, false).unwrap_err();
|
||||
assert_eq!(err.kind(), BlobErrorKind::WrongBlobdir);
|
||||
match err {
|
||||
BlobError::WrongBlobdir { .. } => (),
|
||||
_ => panic!("wrong error type/variant: {:?}", err),
|
||||
}
|
||||
|
||||
fs::write(fname, b"boo").unwrap();
|
||||
let blob = p.get_blob(Param::File, &t.ctx, true).unwrap().unwrap();
|
||||
|
||||
Reference in New Issue
Block a user