Skip to content

Commit

Permalink
Rename write_cache to cache
Browse files Browse the repository at this point in the history
  • Loading branch information
MichaReiser committed Feb 2, 2024
1 parent ce14e4c commit 6818c10
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions crates/ruff/src/commands/format.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)?
Expand All @@ -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)
Expand All @@ -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)
Expand Down

0 comments on commit 6818c10

Please sign in to comment.