Use CompactString for fields of CrateName

Since most of the time, they are shorter than 24 bytes.

Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
This commit is contained in:
Jiahao XU 2022-08-02 22:17:11 +10:00
parent caeb49ce33
commit d430c077d4
No known key found for this signature in database
GPG key ID: 591C0B03040416D6
2 changed files with 8 additions and 6 deletions

View file

@ -4,6 +4,7 @@ use std::{
};
use cargo_toml::{Package, Product};
use compact_str::CompactString;
use log::{debug, error, info, warn};
use miette::{miette, Result};
use reqwest::Client;
@ -19,7 +20,7 @@ pub enum Resolution {
Fetch {
fetcher: Arc<dyn Fetcher>,
package: Package<Meta>,
name: String,
name: CompactString,
version: String,
bin_path: PathBuf,
bin_files: Vec<bins::BinFile>,