From e39bccb866f7f241a31940732ce677755a34a20f Mon Sep 17 00:00:00 2001 From: Stephan Boyer Date: Thu, 28 Nov 2024 13:03:40 -0800 Subject: [PATCH] Update Rust to v1.83.0 --- .github/workflows/ci.yml | 12 ++++++------ src/run.rs | 14 +++++++------- toast.yml | 12 ++++++------ 3 files changed, 19 insertions(+), 19 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 3917c16..3ca99e3 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -90,8 +90,8 @@ jobs: # https://github.com/rust-lang/rustup/issues/2441 # # for more information. - rustup toolchain install 1.81.0 --no-self-update # [ref:rust_1.81.0] - rustup default 1.81.0 # [ref:rust_1.81.0] + rustup toolchain install 1.83.0 --no-self-update # [ref:rust_1.83.0] + rustup default 1.83.0 # [ref:rust_1.83.0] # Add the targets. rustup target add x86_64-pc-windows-msvc @@ -131,8 +131,8 @@ jobs: set -euxo pipefail # Install the appropriate version of Rust. - rustup toolchain install 1.81.0 # [ref:rust_1.81.0] - rustup default 1.81.0 # [ref:rust_1.81.0] + rustup toolchain install 1.83.0 # [ref:rust_1.83.0] + rustup default 1.83.0 # [ref:rust_1.83.0] # Add the targets. rustup target add x86_64-apple-darwin @@ -211,8 +211,8 @@ jobs: set -euxo pipefail # Install the appropriate version of Rust. - rustup toolchain install 1.81.0 # [ref:rust_1.81.0] - rustup default 1.81.0 # [ref:rust_1.81.0] + rustup toolchain install 1.83.0 # [ref:rust_1.83.0] + rustup default 1.83.0 # [ref:rust_1.83.0] # Fetch the program version. VERSION="$(cargo pkgid | cut -d# -f2 | cut -d: -f2)" diff --git a/src/run.rs b/src/run.rs index c0fd9ab..9db933b 100644 --- a/src/run.rs +++ b/src/run.rs @@ -626,9 +626,9 @@ fn vacuum( state: &mut State, first_run: bool, threshold: Byte, - keep: &Option, + keep: Option<&RegexSet>, deletion_chunk_size: usize, - min_age: &Option, + min_age: Option, ) -> io::Result<()> { // Find all images. let image_records = list_image_records(state)?; @@ -674,7 +674,7 @@ fn vacuum( // If the `--min-age` argument is provided, we need to filter out images // which are newer than the provided duration. if let Some(duration) = min_age { - match (SystemTime::now() - *duration).duration_since(UNIX_EPOCH) { + match (SystemTime::now() - duration).duration_since(UNIX_EPOCH) { Ok(time_stamp) => { sorted_image_nodes.retain(|(image_id, image_node)| { if image_node.last_used_since_epoch > time_stamp { @@ -786,9 +786,9 @@ pub fn run( state, *first_run, threshold, - &settings.keep, + settings.keep.as_ref(), settings.deletion_chunk_size, - &settings.min_age, + settings.min_age, )?; state::save(state)?; *first_run = false; @@ -865,9 +865,9 @@ pub fn run( state, *first_run, threshold, - &settings.keep, + settings.keep.as_ref(), settings.deletion_chunk_size, - &settings.min_age, + settings.min_age, )?; } diff --git a/toast.yml b/toast.yml index b401d51..aefb44c 100644 --- a/toast.yml +++ b/toast.yml @@ -17,11 +17,11 @@ command_prefix: | cargo-offline () { cargo --frozen --offline "$@"; } # Use this wrapper for formatting code or checking that code is formatted. We use a nightly Rust - # version for the `trailing_comma` formatting option [tag:rust_fmt_nightly_2024-09-06]. The + # version for the `trailing_comma` formatting option [tag:rust_fmt_nightly_2024-11-28]. The # nightly version was chosen as the latest available release with all components present # according to this page: # https://rust-lang.github.io/rustup-components-history/x86_64-unknown-linux-gnu.html - cargo-fmt () { cargo +nightly-2024-09-06 --frozen --offline fmt --all -- "$@"; } + cargo-fmt () { cargo +nightly-2024-11-28 --frozen --offline fmt --all -- "$@"; } # Make Bash log commands. set -x @@ -92,18 +92,18 @@ tasks: - install_packages - create_user command: | - # Install stable Rust [tag:rust_1.81.0]. + # Install stable Rust [tag:rust_1.83.0]. curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- \ -y \ - --default-toolchain 1.81.0 \ + --default-toolchain 1.83.0 \ --profile minimal \ --component clippy # Add Rust tools to `$PATH`. . "$HOME/.cargo/env" - # Install nightly Rust [ref:rust_fmt_nightly_2024-09-06]. - rustup toolchain install nightly-2024-09-06 --profile minimal --component rustfmt + # Install nightly Rust [ref:rust_fmt_nightly_2024-11-28]. + rustup toolchain install nightly-2024-11-28 --profile minimal --component rustfmt install_tools: description: Install the tools needed to build and validate the program.