Skip to content

Commit

Permalink
Update Rust to v1.55.0
Browse files Browse the repository at this point in the history
  • Loading branch information
stepchowfun committed Sep 10, 2021
1 parent b4d8c89 commit 520c380
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 15 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,8 @@ jobs:
set -euo pipefail
# Install the appropriate version of Rust.
rustup toolchain install 1.53.0 # [ref:rust_1_53_0]
rustup default 1.53.0 # [ref:rust_1_53_0]
rustup toolchain install 1.55.0 # [ref:rust_1_55_0]
rustup default 1.55.0 # [ref:rust_1_55_0]
# Build and test.
RUSTFLAGS='--codegen target-feature=+crt-static' cargo build \
Expand All @@ -75,8 +75,8 @@ jobs:
set -euo pipefail
# Install the appropriate version of Rust.
rustup toolchain install 1.53.0 # [ref:rust_1_53_0]
rustup default 1.53.0 # [ref:rust_1_53_0]
rustup toolchain install 1.55.0 # [ref:rust_1_55_0]
rustup default 1.55.0 # [ref:rust_1_55_0]
# Build and test.
cargo build --locked --release --target x86_64-apple-darwin
Expand Down
10 changes: 5 additions & 5 deletions src/run.rs
Original file line number Diff line number Diff line change
Expand Up @@ -324,7 +324,7 @@ fn space_usage() -> io::Result<Byte> {
.and_then(|output| {
for line in output.lines() {
// Parse the line as a space record.
if let Ok(space_record) = serde_json::from_str::<SpaceRecord>(&line) {
if let Ok(space_record) = serde_json::from_str::<SpaceRecord>(line) {
// Return early if we found the record we're looking for.
if space_record.r#type == "Images" {
return Byte::from_str(&space_record.size).map_err(|_| {
Expand Down Expand Up @@ -417,7 +417,7 @@ fn parse_docker_date(timestamp: &str) -> io::Result<Duration> {

// Parse the date and convert it into a duration since the UNIX epoch.
let duration =
match DateTime::parse_from_str(&timestamp_without_timezone_triad, "%Y-%m-%d %H:%M:%S %z") {
match DateTime::parse_from_str(timestamp_without_timezone_triad, "%Y-%m-%d %H:%M:%S %z") {
Ok(datetime) => {
datetime.signed_duration_since::<chrono::offset::Utc>(DateTime::from(UNIX_EPOCH))
}
Expand Down Expand Up @@ -626,7 +626,7 @@ fn vacuum(
// Start deleting images, beginning with the least recently used.
for (image_id, _) in sorted_image_nodes {
// Delete the image.
if let Err(error) = delete_image(&image_id) {
if let Err(error) = delete_image(image_id) {
// The deletion failed. Just log the error and proceed.
error!("{}", error);
} else {
Expand Down Expand Up @@ -678,7 +678,7 @@ pub fn run(settings: &Settings, state: &mut State, first_run: &mut bool) -> io::

// Run the main vacuum logic.
vacuum(state, *first_run, settings.threshold, &settings.keep)?;
state::save(&state)?;
state::save(state)?;
*first_run = false;

// Spawn `docker events --format '{{json .}}'`.
Expand Down Expand Up @@ -757,7 +757,7 @@ pub fn run(settings: &Settings, state: &mut State, first_run: &mut bool) -> io::
vacuum(state, *first_run, settings.threshold, &settings.keep)?;

// Persist the state.
state::save(&state)?;
state::save(state)?;

// Inform the user that we're done for now.
info!("Going back to sleep\u{2026}");
Expand Down
12 changes: 6 additions & 6 deletions toast.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ 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_2021_06_09].
cargo-fmt () { cargo +nightly-2021-06-09 --frozen --offline fmt --all -- "$@"; }
# version for the `trailing_comma` formatting option [tag:rust_fmt_nightly_2021_09_08].
cargo-fmt () { cargo +nightly-2021-09-08 --frozen --offline fmt --all -- "$@"; }
tasks:
install_packages:
description: Install system packages.
Expand Down Expand Up @@ -70,18 +70,18 @@ tasks:
- install_packages
- create_user
command: |
# Install stable Rust. [tag:rust_1_53_0]
# Install stable Rust. [tag:rust_1_55_0]
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- \
-y \
--default-toolchain 1.53.0 \
--default-toolchain 1.55.0 \
--profile minimal \
--component clippy
# Add Rust tools to `$PATH`.
. "$HOME/.cargo/env"
# Install nightly Rust [ref:rust_fmt_nightly_2021_06_09].
rustup toolchain install nightly-2021-06-09 --profile minimal --component rustfmt
# Install nightly Rust [ref:rust_fmt_nightly_2021_09_08].
rustup toolchain install nightly-2021-09-08 --profile minimal --component rustfmt
install_tools:
description: Install the tools needed to build and validate the program.
Expand Down

0 comments on commit 520c380

Please sign in to comment.