From 389230da9efd7e5726b12dee28a5273da8562796 Mon Sep 17 00:00:00 2001 From: andros21 Date: Sun, 11 Feb 2024 13:56:23 +0000 Subject: [PATCH] chore(src/lib.rs): `RandomState` now exported in `std::hash` (#69) * chore(src/lib.rs): `RandomState` now exported in `std::hash` see https://github.com/rust-lang/rust/releases/tag/1.76.0 see https://github.com/rust-lang/rust/pull/115694/ * chore(ci/cd): handle `rustup update stable` when there is a version mismatch between stable toolchain installed on runner (used) and stable toolchain available from upstream (latest) --- .github/workflows/ci-cd.yml | 7 +++++++ src/lib.rs | 3 +-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci-cd.yml b/.github/workflows/ci-cd.yml index 240744c..aa56477 100644 --- a/.github/workflows/ci-cd.yml +++ b/.github/workflows/ci-cd.yml @@ -37,6 +37,9 @@ jobs: latest="$(curl -sL https://api.github.com/repos/rust-lang/rust/releases/latest | jq -r .tag_name)" echo "rust stable latest: ${latest}" echo "stable_latest=${latest}" >> "$GITHUB_OUTPUT" + echo "rust stable used: ${used}" + used="$(cargo --version | awk '{print $2}')" + echo "stable_used=${used}" >> "$GITHUB_OUTPUT" - name: check cache uses: actions/cache@13aacd865c20de90d75de3b17ebe84f7a17d57d2 id: cache @@ -46,6 +49,10 @@ jobs: ~/.rustup/ target/ key: ${{ runner.os }}-rust-${{ steps.rust.outputs.stable_latest }}-${{ hashFiles('Cargo.toml') }}-${{ hashFiles('Cargo.lock') }} + - name: update toolchain + if: steps.rust.outputs.stable_latest != steps.rust.outputs.stable_used + run: | + rustup update stable - name: cargo fmt run: | cargo fmt -- --check --verbose diff --git a/src/lib.rs b/src/lib.rs index 5dd5515..20280a5 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -4,9 +4,8 @@ use gloo_events::EventListener; use gloo_timers::callback::Interval; use serde::Deserialize; -use std::collections::hash_map::RandomState; use std::collections::HashMap; -use std::hash::{BuildHasher, Hasher}; +use std::hash::{BuildHasher, Hasher, RandomState}; use wasm_bindgen::prelude::*; use web_sys::{Document, Element, HtmlAudioElement, HtmlElement, HtmlInputElement};