summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTomasz Kramkowski <tomasz@kramkow.ski>2023-01-29 17:42:06 +0000
committerTomasz Kramkowski <tomasz@kramkow.ski>2023-01-29 17:42:06 +0000
commit55ec80729147b4c948dc0919569451ac40d2e7ba (patch)
tree70e59fa361636bb0ea055a50ea2f2facbd13284d
parent8700f1a4e37b946f7f5c452a6677a3da3e9d11fa (diff)
downloadpam_usercg_rust-55ec80729147b4c948dc0919569451ac40d2e7ba.tar.gz
pam_usercg_rust-55ec80729147b4c948dc0919569451ac40d2e7ba.tar.xz
pam_usercg_rust-55ec80729147b4c948dc0919569451ac40d2e7ba.zip
Immutably borrow rather than consuming paths
-rw-r--r--src/lib.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/lib.rs b/src/lib.rs
index 569f964..3ffbb69 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -12,9 +12,9 @@ use std::panic;
use std::path::Path;
use std::process;
-fn create_and_open_dir<P: AsRef<Path> + Copy>(
+fn create_and_open_dir<P: AsRef<Path> + ?Sized>(
d: &Dir,
- path: P,
+ path: &P,
) -> std::io::Result<Dir> {
if let Err(e) = d.create_dir(path) {
if e.kind() != ErrorKind::AlreadyExists {