forked from mirrors/jj
backend: reduce BackendError
size somewhat
One of the error types that I later created embedded `BackendError`, but `clippy` complained that the size of the type was too large. This helps address that.
This commit is contained in:
parent
0dcd2fa265
commit
134d85e635
2 changed files with 4 additions and 2 deletions
|
@ -215,7 +215,9 @@ pub enum BackendError {
|
||||||
InvalidUtf8 {
|
InvalidUtf8 {
|
||||||
object_type: String,
|
object_type: String,
|
||||||
hash: String,
|
hash: String,
|
||||||
source: std::string::FromUtf8Error,
|
// Box to reduce size for other error types that include this one:
|
||||||
|
// https://rust-lang.github.io/rust-clippy/master/index.html#result_large_err
|
||||||
|
source: Box<std::string::FromUtf8Error>,
|
||||||
},
|
},
|
||||||
#[error("Object {hash} of type {object_type} not found: {source}")]
|
#[error("Object {hash} of type {object_type} not found: {source}")]
|
||||||
ObjectNotFound {
|
ObjectNotFound {
|
||||||
|
|
|
@ -473,7 +473,7 @@ impl Backend for GitBackend {
|
||||||
BackendError::InvalidUtf8 {
|
BackendError::InvalidUtf8 {
|
||||||
object_type: id.object_type(),
|
object_type: id.object_type(),
|
||||||
hash: id.hex(),
|
hash: id.hex(),
|
||||||
source: err,
|
source: Box::new(err),
|
||||||
}
|
}
|
||||||
})?;
|
})?;
|
||||||
Ok(target)
|
Ok(target)
|
||||||
|
|
Loading…
Reference in a new issue