Skip to content

Commit

Permalink
Stop using result-inspect from Rust version 1.76 onwards
Browse files Browse the repository at this point in the history
This is required to fix "cargo check" with Rust version 1.76+ (currently
in the beta channel) while still supporting older toolchain versions.

The `std::result::Result::inspect` method used to be a nightly-only
experimental API [0] but got stabilized in Rust version 1.76 [1] so we
don't need to depend on the `result-inspect` crate anymore (we could
make it optional but let's just wait until we bump the MSRV accordingly
and drop it entirely).

[0]: https://doc.rust-lang.org/1.74.0/std/result/enum.Result.html#method.inspect
[1]: https://doc.rust-lang.org/beta/std/result/enum.Result.html#method.inspect

Signed-off-by: Michael Weiss <michael.weiss@eviden.com>
  • Loading branch information
primeos-work committed Dec 22, 2023
1 parent 02a037e commit 76a7e3a
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 0 deletions.
1 change: 1 addition & 0 deletions Cargo.lock

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

1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ reqwest = { version = "0.11", features = [ "stream" ] }
resiter = "0.5"
result-inspect = "0.3"
rlimit = "0.10"
rustversion = "1"
semver = { version = "1", features = [ "serde" ] }
serde = "1"
serde_json = "1"
Expand Down
1 change: 1 addition & 0 deletions src/endpoint/configured.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ use anyhow::Error;
use anyhow::Result;
use futures::FutureExt;
use getset::{CopyGetters, Getters};
#[rustversion::before(1.76)]
use result_inspect::ResultInspect;
use shiplift::Container;
use shiplift::Docker;
Expand Down
1 change: 1 addition & 0 deletions src/filestore/staging.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ use anyhow::Error;
use anyhow::Result;
use futures::stream::Stream;
use indicatif::ProgressBar;
#[rustversion::before(1.76)]
use result_inspect::ResultInspect;
use tracing::trace;

Expand Down
3 changes: 3 additions & 0 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,9 @@ use anyhow::Error;
use anyhow::Result;
use aquamarine as _;
use clap::ArgMatches;
// TODO: Drop the rust-inspect dependency once we bump the MSRV to 1.76:
#[rustversion::since(1.76)]
use result_inspect as _;
use tracing::{debug, error};

mod cli;
Expand Down

0 comments on commit 76a7e3a

Please sign in to comment.