Skip to content

Commit

Permalink
Release version 0.7.10
Browse files Browse the repository at this point in the history
  • Loading branch information
sorairolake committed Jan 6, 2024
2 parents a88c861 + 31881fd commit 6f8416e
Show file tree
Hide file tree
Showing 8 changed files with 21 additions and 50 deletions.
2 changes: 1 addition & 1 deletion .bumpversion.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
# SPDX-License-Identifier: Apache-2.0 OR MIT

[tool.bumpversion]
current_version = "0.7.9"
current_version = "0.7.10"

[[tool.bumpversion.files]]
filename = "CITATION.cff"
Expand Down
8 changes: 7 additions & 1 deletion CHANGELOG.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,13 @@ All notable changes to this project will be documented in this file.
The format is based on https://keepachangelog.com/[Keep a Changelog], and this
project adheres to https://semver.org/[Semantic Versioning].

== {compare-url}/v0.7.8\...v0.7.9[0.7.9] - 2024-01-06
== {compare-url}/v0.7.9\...v0.7.10[0.7.10] - 2024-01-06

=== Changed

* Update doctests ({pull-request-url}/72[#72])

== {compare-url}/v0.7.8\...v0.7.9[0.7.9] - 2024-01-06 [YANKED]

=== Changed

Expand Down
2 changes: 1 addition & 1 deletion CITATION.cff
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ message: Please cite this software using these meta data.

# Version information.
date-released: 2024-01-06
version: 0.7.9
version: 0.7.10

# Project information.
abstract: The system exit codes as defined by <sysexits.h> for Rust
Expand Down
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

[package]
name = "sysexits"
version = "0.7.9"
version = "0.7.10"
authors = ["Shun Sakai <[email protected]>"]
edition = "2021"
rust-version = "1.61.0"
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ Add this to your `Cargo.toml`:

```toml
[dependencies]
sysexits = "0.7.9"
sysexits = "0.7.10"
```

### Example
Expand Down
17 changes: 8 additions & 9 deletions src/exit_code.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@
//! [`<sysexits.h>`]: https://man.openbsd.org/sysexits
use core::fmt;
#[cfg(feature = "std")]
use std::process::Termination;

/// A [`Result`](std::result::Result) type based on [`ExitCode`].
///
Expand Down Expand Up @@ -260,8 +258,7 @@ impl ExitCode {

/// Terminates the current process with the exit code defined by `ExitCode`.
///
/// This method is equivalent to [`std::process::exit`] with a restricted
/// exit code.
/// Equivalent to [`std::process::exit`] with a restricted exit code.
///
/// # Examples
///
Expand Down Expand Up @@ -344,10 +341,10 @@ impl_from_exit_code_for_integer!(usize);
#[cfg(feature = "std")]
impl From<ExitCode> for std::process::ExitCode {
/// Converts an `sysexits::ExitCode` into an [`std::process::ExitCode`].
///
/// This method is equivalent to [`ExitCode::report`].
#[inline]
fn from(code: ExitCode) -> Self {
use std::process::Termination;

code.report()
}
}
Expand Down Expand Up @@ -453,7 +450,7 @@ impl TryFrom<std::process::ExitStatus> for ExitCode {
///
/// # Errors
///
/// This method returns [`Err`] in the following situations:
/// Returns [`Err`] if any of the following are true:
///
/// - The exit code is not `0` or `64..=78`.
/// - The exit code is unknown (e.g., the process was terminated by a
Expand Down Expand Up @@ -486,10 +483,10 @@ impl TryFrom<std::process::ExitStatus> for ExitCode {
impl std::error::Error for ExitCode {}

#[cfg(feature = "std")]
impl Termination for ExitCode {
impl std::process::Termination for ExitCode {
#[inline]
fn report(self) -> std::process::ExitCode {
std::process::ExitCode::from(u8::from(self))
u8::from(self).into()
}
}

Expand Down Expand Up @@ -1610,6 +1607,8 @@ mod tests {
#[cfg(feature = "std")]
#[test]
fn report_exit_code() {
use std::process::Termination;

assert_eq!(
format!("{:?}", ExitCode::Ok.report()),
format!("{:?}", std::process::ExitCode::from(0))
Expand Down
36 changes: 1 addition & 35 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,6 @@
//!
//! # Examples
//!
//! ## Returns the exit code as defined by <sysexits.h>
//!
//! If you only use the exit code as defined by `<sysexits.h>`, you can return
//! this from the `main` function.
//!
//! ```
//! # #[cfg(feature = "std")]
//! use std::str;
Expand All @@ -44,39 +39,10 @@
//! # fn main() {}
//! ```
//!
//! ## Combine with other exit codes
//!
//! [`ExitCode`] can be converted to [`std::process::ExitCode`] by the [`From`]
//! trait, so you can combine it with your own exit codes or
//! [`std::process::ExitCode`].
//!
//! ```
//! # #[cfg(feature = "std")]
//! use std::{
//! io::{self, Read},
//! process::ExitCode,
//! };
//!
//! # #[cfg(feature = "std")]
//! fn main() -> ExitCode {
//! let mut buf = String::new();
//! if let Err(err) = io::stdin().read_to_string(&mut buf) {
//! eprintln!("{err}");
//! sysexits::ExitCode::from(err).into()
//! } else {
//! print!("{buf}");
//! ExitCode::SUCCESS
//! }
//! }
//! #
//! # #[cfg(not(feature = "std"))]
//! # fn main() {}
//! ```
//!
//! [`<sysexits.h>`]: https://man.openbsd.org/sysexits
#![cfg_attr(feature = "extended_io_error", feature(io_error_more))]
#![doc(html_root_url = "https://docs.rs/sysexits/0.7.9/")]
#![doc(html_root_url = "https://docs.rs/sysexits/0.7.10/")]
#![no_std]
#![cfg_attr(doc_cfg, feature(doc_auto_cfg, doc_cfg))]
// Lint levels of rustc.
Expand Down

0 comments on commit 6f8416e

Please sign in to comment.