Skip to content

Commit 9e6cda3

Browse files
committed
change PathBuf to Path file serialize/deserialize
1 parent 7667eda commit 9e6cda3

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

cot/src/cache/store/file.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,7 @@ impl FileStore {
207207
value: Value,
208208
expiry: Timeout,
209209
file: &mut tokio::fs::File,
210-
file_path: &std::path::PathBuf,
210+
file_path: &Path,
211211
) -> CacheStoreResult<()> {
212212
let result = async {
213213
let timeout = expiry.canonicalize();
@@ -246,7 +246,7 @@ impl FileStore {
246246
async fn check_expiry(
247247
&self,
248248
file: &mut tokio::fs::File,
249-
file_path: &std::path::PathBuf,
249+
file_path: &Path,
250250
) -> CacheStoreResult<bool> {
251251
let mut header: [u8; EXPIRY_HEADER_OFFSET] = [0; EXPIRY_HEADER_OFFSET];
252252

@@ -285,7 +285,7 @@ impl FileStore {
285285
async fn deserialize_data(
286286
&self,
287287
file: &mut tokio::fs::File,
288-
file_path: &std::path::PathBuf,
288+
file_path: &Path,
289289
) -> CacheStoreResult<Option<Value>> {
290290
if !self.check_expiry(file, file_path).await? {
291291
return Ok(None);

0 commit comments

Comments
 (0)