ok/jj
1
0
Fork 0
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:
Waleed Khan 2023-08-20 16:28:53 -07:00
parent 0dcd2fa265
commit 134d85e635
2 changed files with 4 additions and 2 deletions

View file

@ -215,7 +215,9 @@ pub enum BackendError {
InvalidUtf8 {
object_type: 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}")]
ObjectNotFound {

View file

@ -473,7 +473,7 @@ impl Backend for GitBackend {
BackendError::InvalidUtf8 {
object_type: id.object_type(),
hash: id.hex(),
source: err,
source: Box::new(err),
}
})?;
Ok(target)