diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 250d042..8636cd2 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -46,6 +46,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 @@ -55,6 +58,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/main.rs b/src/main.rs index 205cf48..065b165 100644 --- a/src/main.rs +++ b/src/main.rs @@ -1,7 +1,7 @@ use log::{error, info, warn}; -use std::collections::{hash_map::DefaultHasher, hash_map::RandomState, HashMap}; -use std::hash::{BuildHasher, Hash, Hasher}; +use std::collections::HashMap; +use std::hash::{BuildHasher, DefaultHasher, Hash, Hasher, RandomState}; use teloxide::{ dispatching::dialogue::{serializer::Json, ErasedStorage, SqliteStorage, Storage}, prelude::*,