Skip to content

Commit 295e784

Browse files
committed
Update to unsafe-io 0.3.0.
1 parent 99526af commit 295e784

File tree

6 files changed

+13
-16
lines changed

6 files changed

+13
-16
lines changed

cap-async-std/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ readme = "README.md"
1717
arf-strings = { version = "0.3.0", optional = true }
1818
async-std = { version = "1.8.0", features = ["attributes"] }
1919
cap-primitives = { path = "../cap-primitives", version = "^0.11.0"}
20-
unsafe-io = "0.2.0"
20+
unsafe-io = "0.3.0"
2121

2222
[features]
2323
default = []

cap-async-std/src/fs/dir.rs

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ use cap_primitives::fs::{
1414
remove_open_dir_all, rename, set_permissions, stat, DirOptions, FollowSymlinks, Permissions,
1515
};
1616
use std::fmt;
17-
use unsafe_io::{AsUnsafeFile, IntoUnsafeFile};
17+
use unsafe_io::{AsUnsafeFile, FromUnsafeFile};
1818
#[cfg(unix)]
1919
use {
2020
crate::os::unix::net::{UnixDatagram, UnixListener, UnixStream},
@@ -358,8 +358,7 @@ impl Dir {
358358
/// to a concurrent rename of the directory.
359359
#[inline]
360360
pub fn remove_open_dir(self) -> io::Result<()> {
361-
let file = self.std_file.into_file();
362-
remove_open_dir(file)
361+
remove_open_dir(std::fs::File::from_filelike(self.std_file))
363362
}
364363

365364
/// Removes the directory referenced by `self`, after removing all its contents, and
@@ -370,8 +369,7 @@ impl Dir {
370369
/// to a concurrent rename of the directory.
371370
#[inline]
372371
pub fn remove_open_dir_all(self) -> io::Result<()> {
373-
let file = self.std_file.into_file();
374-
remove_open_dir_all(file)
372+
remove_open_dir_all(std::fs::File::from_filelike(self.std_file))
375373
}
376374

377375
/// Removes a file from a filesystem.

cap-fs-ext/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ async-std = { version = "1.8.0", optional = true }
1919
cap-async-std = { path = "../cap-async-std", optional = true, version = "^0.11.0"}
2020
cap-std = { path = "../cap-std", optional = true, version = "^0.11.0"}
2121
cap-primitives = { path = "../cap-primitives", version = "^0.11.0"}
22-
unsafe-io = "0.2.0"
22+
unsafe-io = "0.3.0"
2323

2424
[features]
2525
default = ["std"]

cap-fs-ext/src/reopen.rs

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ use std::io;
33
#[cfg(any(feature = "std", feature = "async_std"))]
44
use unsafe_io::AsUnsafeFile;
55
#[cfg(feature = "async_std")]
6-
use unsafe_io::{FromUnsafeFile, IntoUnsafeFile};
6+
use unsafe_io::FromUnsafeFile;
77

88
/// A trait for the `reopen` function.
99
pub trait Reopen {
@@ -58,8 +58,7 @@ impl Reopen for async_std::fs::File {
5858
#[inline]
5959
fn reopen(&self, options: &OpenOptions) -> io::Result<Self> {
6060
let file = reopen(&self.as_file_view(), options)?;
61-
let unsafe_file = file.into_unsafe_file();
62-
Ok(unsafe { async_std::fs::File::from_unsafe_file(unsafe_file) })
61+
Ok(async_std::fs::File::from_filelike(file))
6362
}
6463
}
6564

@@ -68,8 +67,8 @@ impl Reopen for cap_async_std::fs::File {
6867
#[inline]
6968
fn reopen(&self, options: &OpenOptions) -> io::Result<Self> {
7069
let file = reopen(&self.as_file_view(), options)?;
71-
let unsafe_file = file.into_unsafe_file();
72-
Ok(unsafe { Self::from_std(async_std::fs::File::from_unsafe_file(unsafe_file)) })
70+
let std = async_std::fs::File::from_filelike(file);
71+
Ok(unsafe { Self::from_std(std) })
7372
}
7473
}
7574

@@ -78,7 +77,7 @@ impl Reopen for cap_async_std::fs_utf8::File {
7877
#[inline]
7978
fn reopen(&self, options: &OpenOptions) -> io::Result<Self> {
8079
let file = reopen(&self.as_file_view(), options)?;
81-
let unsafe_file = file.into_unsafe_file();
82-
Ok(unsafe { Self::from_std(async_std::fs::File::from_unsafe_file(unsafe_file)) })
80+
let std = async_std::fs::File::from_filelike(file);
81+
Ok(unsafe { Self::from_std(std) })
8382
}
8483
}

cap-primitives/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ arbitrary = { version = "0.4.7", optional = true, features = ["derive"] }
1818
ipnet = "2.3.0"
1919
maybe-owned = "0.3.4"
2020
fs-set-times = "0.2.3"
21-
unsafe-io = "0.2.0"
21+
unsafe-io = "0.3.0"
2222

2323
[target.'cfg(not(windows))'.dependencies]
2424
posish = "0.5.9"

cap-std/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ readme = "README.md"
1616
[dependencies]
1717
arf-strings = { version = "0.3.0", optional = true }
1818
cap-primitives = { path = "../cap-primitives", version = "^0.11.0"}
19-
unsafe-io = "0.2.0"
19+
unsafe-io = "0.3.0"
2020

2121
[features]
2222
default = []

0 commit comments

Comments
 (0)