Skip to content

Commit

Permalink
Update to cap-std 3, bump to 4
Browse files Browse the repository at this point in the history
Adapt to the changes in that crate, xref
bytecodealliance/cap-std#343
  • Loading branch information
cgwalters committed Jan 18, 2024
1 parent 550c3b0 commit 0a95417
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 7 deletions.
6 changes: 3 additions & 3 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@ name = "cap-std-ext"
readme = "README.md"
repository = "https://github.com/coreos/cap-std-ext"
# For historical reasons, the major version number is one greater than the cap-std major.
version = "3.0.1"
version = "4.0.0"

[dependencies]
cap-tempfile = "2"
cap-primitives = "2"
cap-tempfile = "3"
cap-primitives = "3"

[target.'cfg(not(windows))'.dependencies]
rustix = { version = "0.38", features = ["fs", "procfs", "process", "pipe"] }
Expand Down
4 changes: 2 additions & 2 deletions src/dirext.rs
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ pub trait CapStdExtDirExt {
/// somedir.atomic_replace_with("somefilename", |f| -> io::Result<_> {
/// f.write_all(contents)?;
/// f.flush()?;
/// use std::os::unix::prelude::PermissionsExt;
/// use cap_std::fs::PermissionsExt;
/// let perms = cap_std::fs::Permissions::from_mode(0o600);
/// f.get_mut().as_file_mut().set_permissions(perms)?;
/// Ok(())
Expand Down Expand Up @@ -276,7 +276,7 @@ impl CapStdExtDirExt for Dir {
// secret data.
#[cfg(unix)]
{
use std::os::unix::prelude::PermissionsExt;
use cap_std::fs::PermissionsExt;
let perms = cap_std::fs::Permissions::from_mode(0o600);
f.get_mut().as_file_mut().set_permissions(perms)?;
}
Expand Down
3 changes: 1 addition & 2 deletions tests/it/main.rs
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
use anyhow::Result;

use cap_std::fs::{Dir, File, Permissions};
use cap_std::fs::{Dir, File, Permissions, PermissionsExt};
use cap_std_ext::cap_std;
use cap_std_ext::cmdext::CapStdExtCommandExt;
use cap_std_ext::dirext::CapStdExtDirExt;
use std::io::Write;
use std::os::unix::prelude::PermissionsExt;
use std::path::Path;
use std::{process::Command, sync::Arc};

Expand Down

0 comments on commit 0a95417

Please sign in to comment.