Skip to content

Commit

Permalink
{RandomState, DefaultHasher} now exported in std::hash (#31)
Browse files Browse the repository at this point in the history
* chore(src/lib.rs): `{RandomState, DefaultHasher}` now exported in `std::hash`

see https://github.com/rust-lang/rust/releases/tag/1.76.0
see rust-lang/rust#115694

* chore(ci): handle `rustup update stable`

when there is a version mismatch between stable toolchain
installed on runner (used) and stable toolchain available
from upstream (latest)
  • Loading branch information
andros21 authored Feb 11, 2024
1 parent c85acdd commit db4c8d4
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
7 changes: 7 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
4 changes: 2 additions & 2 deletions src/main.rs
Original file line number Diff line number Diff line change
@@ -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::*,
Expand Down

0 comments on commit db4c8d4

Please sign in to comment.