1
0
mirror of https://github.com/sharkdp/bat synced 2026-07-29 18:01:43 +00:00

Fix all lints that are new with Rust 1.54

They are all of the following type:
https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow
This commit is contained in:
Martin Nordholts
2021-08-18 20:37:38 +02:00
parent cbd96237fd
commit ed09f90e5e
7 changed files with 16 additions and 16 deletions
+1 -1
View File
@@ -301,7 +301,7 @@ impl App {
.map(|style_str| {
style_str
.split(',')
.map(|x| StyleComponent::from_str(&x))
.map(|x| StyleComponent::from_str(x))
.collect::<Result<Vec<StyleComponent>>>()
})
.transpose()?;
+2 -2
View File
@@ -25,7 +25,7 @@ pub fn clear_assets() {
pub fn assets_from_cache_or_binary(use_custom_assets: bool) -> Result<HighlightingAssets> {
let cache_dir = PROJECT_DIRS.cache_dir();
if let Some(metadata) = AssetsMetadata::load_from_folder(&cache_dir)? {
if let Some(metadata) = AssetsMetadata::load_from_folder(cache_dir)? {
if !metadata.is_compatible_with(crate_version!()) {
return Err(format!(
"The binary caches for the user-customized syntaxes and themes \
@@ -42,7 +42,7 @@ pub fn assets_from_cache_or_binary(use_custom_assets: bool) -> Result<Highlighti
}
let custom_assets = if use_custom_assets {
HighlightingAssets::from_cache(&cache_dir).ok()
HighlightingAssets::from_cache(cache_dir).ok()
} else {
None
};
+1 -1
View File
@@ -226,7 +226,7 @@ pub fn list_themes(cfg: &Config) -> Result<()> {
fn run_controller(inputs: Vec<Input>, config: &Config) -> Result<bool> {
let assets = assets_from_cache_or_binary(config.use_custom_assets)?;
let controller = Controller::new(&config, &assets);
let controller = Controller::new(config, &assets);
controller.run(inputs)
}