Skip to content

Commit

Permalink
Rename PreprocessorCacheEntry::write to serialize_to
Browse files Browse the repository at this point in the history
It's more idiomatic in the Rust world, and makes it more obvious.
  • Loading branch information
Alphare authored and sylvestre committed Oct 30, 2023
1 parent 099a228 commit 3e3d3ec
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/cache/disk.rs
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ impl Storage for DiskCache {
) -> Result<()> {
let key = normalize_key(key);
let mut buf = vec![];
preprocessor_cache_entry.write(&mut buf)?;
preprocessor_cache_entry.serialize_to(&mut buf)?;
Ok(self
.preprocessor_cache
.lock()
Expand Down
2 changes: 1 addition & 1 deletion src/compiler/preprocessor_cache.rs
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ impl PreprocessorCacheEntry {
}

/// Serialize the preprocessor cache entry to `buf`
pub fn write(&self, buf: &mut impl Write) -> Result<(), Error> {
pub fn serialize_to(&self, buf: &mut impl Write) -> Result<(), Error> {
// Add the starting byte for version check since `bincode` doesn't
// support it.
buf.write_all(&[FORMAT_VERSION])?;
Expand Down

0 comments on commit 3e3d3ec

Please sign in to comment.