From 420473d214ba4fd89c4e3766c9c5c49397b9ba4a Mon Sep 17 00:00:00 2001 From: Severin Siffert Date: Fri, 4 Aug 2023 14:26:39 +0200 Subject: [PATCH] chore: update Rust version (#455) --- .github/workflows/e2e.yml | 2 +- .github/workflows/fmt.yml | 2 +- .github/workflows/ic-ref.yml | 2 +- .github/workflows/lint.yml | 2 +- .github/workflows/release.yml | 4 ++-- .github/workflows/test.yml | 2 +- Cargo.toml | 2 +- ic-agent/src/identity/basic.rs | 2 +- ic-utils/src/call/expiry.rs | 9 ++------- rust-toolchain.toml | 2 +- 10 files changed, 12 insertions(+), 17 deletions(-) diff --git a/.github/workflows/e2e.yml b/.github/workflows/e2e.yml index 68da5eff..4844ff8d 100644 --- a/.github/workflows/e2e.yml +++ b/.github/workflows/e2e.yml @@ -11,7 +11,7 @@ jobs: fail-fast: false matrix: os: [ macos-latest, ubuntu-latest ] - rust: [ '1.65.0' ] + rust: [ '1.71.1' ] dfx: [ '0.8.4', '0.9.2', '0.10.1', '0.11.1' ] steps: diff --git a/.github/workflows/fmt.yml b/.github/workflows/fmt.yml index ecdac297..239a9e14 100644 --- a/.github/workflows/fmt.yml +++ b/.github/workflows/fmt.yml @@ -8,7 +8,7 @@ jobs: runs-on: ${{ matrix.os }} strategy: matrix: - rust: [ '1.65.0' ] + rust: [ '1.71.1' ] os: [ ubuntu-latest ] steps: diff --git a/.github/workflows/ic-ref.yml b/.github/workflows/ic-ref.yml index 5e0d8556..87644f14 100644 --- a/.github/workflows/ic-ref.yml +++ b/.github/workflows/ic-ref.yml @@ -17,7 +17,7 @@ jobs: ic-hs-ref: "3d71032e" wallet-tag: "20230308" os: ubuntu-latest - rust: "1.65.0" + rust: "1.71.1" steps: - uses: actions/setup-node@v3 diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index d7976a84..98bcaf51 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -8,7 +8,7 @@ jobs: runs-on: ${{ matrix.os }} strategy: matrix: - rust: ["1.65.0"] + rust: ["1.71.1"] os: [ubuntu-latest] steps: diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index f2788cb5..a988686a 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -16,12 +16,12 @@ jobs: name: linux binary_path: target/x86_64-unknown-linux-musl/release binary_files: icx - rust: '1.65.0' + rust: '1.71.1' - os: macos-latest name: macos binary_path: target/release binary_files: icx - rust: '1.65.0' + rust: '1.71.1' steps: - uses: actions/checkout@master diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 16c3e1e8..b3d44a07 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -11,7 +11,7 @@ jobs: runs-on: ${{ matrix.os }} strategy: matrix: - rust: ["1.65.0"] + rust: ["1.71.1"] os: [ubuntu-latest, macos-latest, windows-latest] steps: diff --git a/Cargo.toml b/Cargo.toml index 29cc829c..f0a13397 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -14,7 +14,7 @@ version = "0.25.0" authors = ["DFINITY Stiftung "] edition = "2021" repository = "https://github.com/dfinity/agent-rs" -rust-version = "1.65.0" +rust-version = "1.71.1" license = "Apache-2.0" [workspace.dependencies] diff --git a/ic-agent/src/identity/basic.rs b/ic-agent/src/identity/basic.rs index 90d4c19e..f925ad13 100644 --- a/ic-agent/src/identity/basic.rs +++ b/ic-agent/src/identity/basic.rs @@ -40,7 +40,7 @@ impl BasicIdentity { .collect::, std::io::Error>>()?; Ok(BasicIdentity::from_key_pair(Ed25519KeyPair::from_pkcs8( - pem::parse(&bytes)?.contents(), + pem::parse(bytes)?.contents(), )?)) } diff --git a/ic-utils/src/call/expiry.rs b/ic-utils/src/call/expiry.rs index 4da60e39..5d60c50f 100644 --- a/ic-utils/src/call/expiry.rs +++ b/ic-utils/src/call/expiry.rs @@ -5,10 +5,11 @@ use time::OffsetDateTime; /// An expiry value. Either not specified (the default), a delay relative to the time the /// call is made, or a specific date time. -#[derive(Clone, Debug, Ord, PartialOrd, Eq, PartialEq)] +#[derive(Clone, Debug, Ord, PartialOrd, Eq, PartialEq, Default)] pub enum Expiry { /// Unspecified. Will not try to override the Agent's value, which might itself have /// its own default value. + #[default] Unspecified, /// A duration that will be added to the system time when the call is made. @@ -65,9 +66,3 @@ impl From for Expiry { Self::DateTime(dt) } } - -impl Default for Expiry { - fn default() -> Self { - Expiry::Unspecified - } -} diff --git a/rust-toolchain.toml b/rust-toolchain.toml index b314ae52..ebd21eff 100644 --- a/rust-toolchain.toml +++ b/rust-toolchain.toml @@ -1,4 +1,4 @@ [toolchain] -channel = "1.65.0" +channel = "1.71.1" components = ["rustfmt", "clippy"] targets = ["wasm32-unknown-unknown"]