commit 722270dd68724047fa8ef31a80783af76a4eddea
parent a70d7ab80b7d012f8fafc531b6f83a7bba9b32c5
Author: Zack Newman <zack@philomathiclife.com>
Date: Tue, 25 Jul 2023 22:30:46 -0600
update priv_sep dep
Diffstat:
3 files changed, 21 insertions(+), 15 deletions(-)
diff --git a/Cargo.toml b/Cargo.toml
@@ -9,7 +9,7 @@ license = "MIT OR Apache-2.0"
name = "calc_rational"
readme = "README.md"
repository = "https://git.philomathiclife.com/repos/calc_rational/"
-version = "0.5.0"
+version = "0.5.1"
[lib]
name = "calc_lib"
@@ -24,7 +24,7 @@ num-bigint = { version = "0.4.3", default-features = false }
num-integer = { version = "0.1.45", default-features = false }
num-rational = { version = "0.4.1", default-features = false, features = ["num-bigint"] }
num-traits = { version = "0.2.16", default-features = false }
-priv_sep = { version = "0.2.0", default-features = false, features = ["openbsd"], optional = true }
+priv_sep = { version = "0.3.0", default-features = false, features = ["openbsd"], optional = true }
rand = { version = "0.8.5", default-features = false, features = ["std", "std_rng"], optional = true }
[build-dependencies]
diff --git a/README.md b/README.md
@@ -152,7 +152,7 @@ Errors due to a language violation (e.g., dividing by `0`) manifest into an erro
and [`io::Error`](https://doc.rust-lang.org/std/io/struct.Error.html)s caused by writing to the global
standard output stream lead to program abortion. On OpenBSD-stable when compiled with the `priv_sep` feature,
it will error if [`pledge(2)`](https://man.openbsd.org/amd64/pledge.2) errors with the promise of `"stdio"`
-returning the corresponding [`cint`](https://doc.rust-lang.org/core/ffi/type.c_int.html).
+returning the corresponding [`c_int`](https://doc.rust-lang.org/core/ffi/type.c_int.html).
## Exiting
@@ -177,23 +177,29 @@ target. Note one must be aware of the ASCII encoding requirement. In particular
```bash
[zack@laptop ~]$ cargo install --all-features calc_rational
Updating crates.io index
- Installing calc_rational v0.4.0
+ Downloaded calc_rational v0.5.1
+ Downloaded 1 crate (35.3 KB) in 0.60s
+ Installing calc_rational v0.5.1
+ Updating crates.io index
Compiling autocfg v1.1.0
- Compiling libc v0.2.142
+ Compiling semver v1.0.18
+ Compiling libc v0.2.147
Compiling cfg-if v1.0.0
Compiling ppv-lite86 v0.2.17
- Compiling num-traits v0.2.15
+ Compiling num-traits v0.2.16
Compiling num-integer v0.1.45
Compiling num-bigint v0.4.3
Compiling num-rational v0.4.1
- Compiling getrandom v0.2.9
+ Compiling rustc_version v0.4.0
+ Compiling priv_sep v0.3.0
+ Compiling calc_rational v0.5.1
+ Compiling getrandom v0.2.10
Compiling rand_core v0.6.4
Compiling rand_chacha v0.3.1
Compiling rand v0.8.5
- Compiling calc_rational v0.4.0 (/home/zack/calc_rational)
- Finished release [optimized] target(s) in 5.54s
+ Finished release [optimized] target(s) in 6.92s
Installing /home/zack/.cargo/bin/calc
- Installed package `calc_rational v0.4.0` (executable `calc`)
+ Installed package `calc_rational v0.5.1` (executable `calc`)
```
### Building and testing
@@ -214,8 +220,8 @@ Cloning into 'calc_rational'...
Compiling num-bigint v0.4.3
Compiling num-rational v0.4.1
Compiling rustc_version v0.4.0
- Compiling priv_sep v0.2.0
- Compiling calc_rational v0.5.0 (/home/zack/calc_rational)
+ Compiling priv_sep v0.3.0
+ Compiling calc_rational v0.5.1 (/home/zack/calc_rational)
Compiling getrandom v0.2.10
Compiling rand_core v0.6.4
Compiling rand_chacha v0.3.1
@@ -233,7 +239,7 @@ Cloning into 'calc_rational'...
Compiling num-rational v0.4.1
Compiling rustc_version v0.4.0
Compiling priv_sep v0.2.0
- Compiling calc_rational v0.5.0 (/home/zack/calc_rational)
+ Compiling calc_rational v0.5.1 (/home/zack/calc_rational)
Compiling getrandom v0.2.10
Compiling rand_core v0.6.4
Compiling rand_chacha v0.3.1
diff --git a/src/main.rs b/src/main.rs
@@ -151,7 +151,7 @@
//! and [`io::Error`](https://doc.rust-lang.org/std/io/struct.Error.html)s caused by writing to the global
//! standard output stream lead to program abortion. On OpenBSD-stable when compiled with the `priv_sep` feature,
//! it will error if [`pledge(2)`](https://man.openbsd.org/amd64/pledge.2) errors with the promise of
-//! `"stdio"` returning the corresponding [`cint`](https://doc.rust-lang.org/core/ffi/type.c_int.html).
+//! `"stdio"` returning the corresponding [`c_int`](https://doc.rust-lang.org/core/ffi/type.c_int.html).
//!
//! ## Exiting
//!
@@ -226,7 +226,7 @@ fn main() -> Result<(), Err> {
#[cfg(all(feature = "priv_sep", target_os = "openbsd"))]
#[inline]
fn privsep() -> Result<(), Err> {
- priv_sep::pledge(&[Promise::Stdio]).map_err(Err::Pledge)
+ priv_sep::pledge(Some([Promise::Stdio])).map_err(Err::Pledge)
}
/// Returns Ok.
#[allow(clippy::unnecessary_wraps)]