Skip to content

Commit fa394e4

Browse files
committed
Fix compilation errors on Rust nightly.
Fix compilation errors that started appering on Rust nightly. This appears to just need an explicit dereference where one was not previously needed. An example of the error message is: ``` error[E0308]: mismatched types --> cap-primitives/src/fs/via_parent/rename.rs:22:58 | 22 | let (old_dir, old_basename) = open_parent(old_start, &old_path)?; | ^^^^^^^^^ expected struct `Path`, found opaque type | ::: cap-primitives/src/rustix/fs/dir_utils.rs:67:48 | 67 | pub(crate) fn strip_dir_suffix(path: &Path) -> impl Deref<Target = Path> + '_ { | ------------------------------ the found opaque type | = note: expected struct `Path` found opaque type `impl Deref<Target = Path>` ```
1 parent 0271b8a commit fa394e4

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

cap-primitives/src/fs/via_parent/create_dir.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ pub(crate) fn create_dir(start: &fs::File, path: &Path, options: &DirOptions) ->
1313
// slashes.
1414
let path = strip_dir_suffix(path);
1515

16-
let (dir, basename) = open_parent(start, &path)?;
16+
let (dir, basename) = open_parent(start, &*path)?;
1717

1818
create_dir_unchecked(&dir, basename.as_ref(), options)
1919
}

cap-primitives/src/fs/via_parent/rename.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@ pub(crate) fn rename(
1919
let old_path = strip_dir_suffix(old_path);
2020
let new_path = strip_dir_suffix(new_path);
2121

22-
let (old_dir, old_basename) = open_parent(old_start, &old_path)?;
23-
let (new_dir, new_basename) = open_parent(new_start, &new_path)?;
22+
let (old_dir, old_basename) = open_parent(old_start, &*old_path)?;
23+
let (new_dir, new_basename) = open_parent(new_start, &*new_path)?;
2424

2525
rename_unchecked(
2626
&old_dir,

0 commit comments

Comments
 (0)