From 6818c10dd4bc5d7dfd20c10923bfb5a8361e8b55 Mon Sep 17 00:00:00 2001 From: Micha Reiser Date: Fri, 2 Feb 2024 17:55:16 +0100 Subject: [PATCH] Rename `write_cache` to `cache` --- crates/ruff/src/commands/format.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/crates/ruff/src/commands/format.rs b/crates/ruff/src/commands/format.rs index 1ce0a1f31fe2a9..8f719ad07e7bc3 100644 --- a/crates/ruff/src/commands/format.rs +++ b/crates/ruff/src/commands/format.rs @@ -267,7 +267,7 @@ pub(crate) fn format_path( }; // Don't write back to the cache if formatting a range. - let write_cache = cache.filter(|_| range.is_none()); + let cache = cache.filter(|_| range.is_none()); // Format the source. let format_result = match format_source(&unformatted, source_type, Some(path), settings, range)? @@ -281,7 +281,7 @@ pub(crate) fn format_path( .write(&mut writer) .map_err(|err| FormatCommandError::Write(Some(path.to_path_buf()), err))?; - if let Some(cache) = write_cache { + if let Some(cache) = cache { if let Ok(cache_key) = FileCacheKey::from_path(path) { let relative_path = cache .relative_path(path) @@ -299,7 +299,7 @@ pub(crate) fn format_path( }, }, FormattedSource::Unchanged => { - if let Some(cache) = write_cache { + if let Some(cache) = cache { if let Ok(cache_key) = FileCacheKey::from_path(path) { let relative_path = cache .relative_path(path)