mirror of
https://github.com/cargo-bins/cargo-binstall.git
synced 2025-05-05 19:50:02 +00:00
Optimization: Box variants in Error to reduce size and remove unused variants in BinstallError
(#530)
* Box `HttpError` in `binsalk_downloader::remote::Error::Http` as `HttpError` contains `Url` which are too big. * Box `HttpError` in `BinstallError::Http` same as the previous commit. * Box `TinyTemplateError` in `BinstallError::Template` since `TinyTemplateError` is 56 bytes large where most of the other variants are below 40 bytes large. * Rm unsed variant `BinstallError::VersionUnavailable` * Box `CratesIoApiError` in `BinstallError::CratesIoApi` It is 32 bytes large while other variants are below 40 bytes large. * Improve err msg for `BinstallError::CrateContext` * Rm unused variant `BinstallError::VersionReq` Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
This commit is contained in:
parent
933c6425ef
commit
c34a2850b3
3 changed files with 15 additions and 37 deletions
|
@ -38,7 +38,7 @@ pub async fn fetch_crate_cratesio(
|
|||
.await
|
||||
.map_err(|err| BinstallError::CratesIoApi {
|
||||
crate_name: name.into(),
|
||||
err,
|
||||
err: Box::new(err),
|
||||
})?;
|
||||
|
||||
// Locate matching version
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue