Skip to content

Commit

Permalink
chore: Update rust to 1.58.1 (#138)
Browse files Browse the repository at this point in the history
* Update to 1.58.1

* Set crate edition to 2021

* Add MSRV

* Resolve new clippy lints

* Update .github/workflows/ci.yaml

Co-authored-by: Linwei Shang <github@lwshang.com>
  • Loading branch information
adamspofford-dfinity and lwshang authored Mar 31, 2022
1 parent 917b3cf commit f18e9f5
Show file tree
Hide file tree
Showing 8 changed files with 12 additions and 23 deletions.
5 changes: 3 additions & 2 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,16 @@ jobs:
strategy:
matrix:
node-version: [12.x]
rust: ['1.58.1']

steps:
- name: Checkout
uses: actions/checkout@v2

- name: Install Rust
run: |
rustup update 1.52.1 --no-self-update
rustup default 1.52.1
rustup update ${{ matrix.rust }} --no-self-update
rustup default ${{ matrix.rust }}
rustup target add wasm32-unknown-unknown
- name: Install DFINITY SDK
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/e2e.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
strategy:
matrix:
os: [ macos-latest, ubuntu-latest ]
rust: [ '1.52.1' ]
rust: [ '1.58.1' ]
# only dfx >= 0.8.3 lets us query multiple controllers
dfx: [ '0.9.2' ]
env:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/fmt.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ jobs:
runs-on: ${{ matrix.os }}
strategy:
matrix:
rust: [ '1.52.1' ]
rust: [ '1.58.1' ]
os: [ ubuntu-latest ]

steps:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/lint.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ jobs:
strategy:
fail-fast: false
matrix:
rust: ['1.52.1']
rust: ['1.58.1']
os: [ubuntu-latest]
node-version: ['12.x']

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
strategy:
matrix:
os: [ubuntu-latest, macos-latest]
rust: ['1.52.1']
rust: ['1.58.1']
node-version: ['12.x']
steps:
- uses: actions/checkout@v1
Expand Down
2 changes: 1 addition & 1 deletion rust-toolchain.toml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[toolchain]
channel = "1.55.0"
channel = "1.58.1"
components = ["clippy", "rustfmt"]
targets = ["wasm32-unknown-unknown"]
3 changes: 2 additions & 1 deletion wallet/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@
name = "wallet"
version = "0.3.0"
authors = ["DFINITY Stiftung <sdk@dfinity.org>"]
edition = "2018"
edition = "2021"
rust-version = "1.58.1"

[lib]
crate-type = ["cdylib"]
Expand Down
17 changes: 2 additions & 15 deletions wallet/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,9 @@ use events::{record, Event, EventKind, ManagedList, MANAGED_LIST};

const WALLET_API_VERSION: &str = env!("CARGO_PKG_VERSION");

#[derive(Default)]
struct WalletWASMBytes(Option<serde_bytes::ByteBuf>);

impl Default for WalletWASMBytes {
fn default() -> Self {
WalletWASMBytes(None)
}
}

/// The wallet (this canister's) name.
#[derive(Default)]
struct WalletName(pub(crate) Option<String>);
Expand Down Expand Up @@ -160,6 +155,7 @@ fn set_name(name: String) {
**************************************************************************************************/
include!(concat!(env!("OUT_DIR"), "/assets.rs"));

#[derive(Default)]
struct Assets {
contents: HashMap<&'static str, (Vec<HeaderField>, &'static [u8])>,
hashes: AssetHashes,
Expand All @@ -169,15 +165,6 @@ thread_local! {
static ASSETS: RefCell<Assets> = Default::default();
}

impl Default for Assets {
fn default() -> Self {
Self {
hashes: AssetHashes::default(),
contents: HashMap::default(),
}
}
}

type AssetHashes = RbTree<&'static str, Hash>;
type HeaderField = (String, String);

Expand Down

0 comments on commit f18e9f5

Please sign in to comment.