Upgrade to Rust 1.79 (#11875)

This commit is contained in:
Micha Reiser 2024-06-17 07:15:10 +01:00 committed by GitHub
parent 355d26f05c
commit 1f654ee729
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
6 changed files with 10 additions and 10 deletions

View file

@ -1,8 +1,10 @@
use crate::registry::Rule;
use ruff_macros::CacheKey;
use std::fmt::{Debug, Display, Formatter};
use std::iter::FusedIterator;
use ruff_macros::CacheKey;
use crate::registry::Rule;
const RULESET_SIZE: usize = 14;
/// A set of [`Rule`]s.
@ -367,7 +369,7 @@ impl Iterator for RuleSetIterator {
let rule_value = self.index * RuleSet::SLICE_BITS + bit;
// SAFETY: RuleSet guarantees that only valid rules are stored in the set.
#[allow(unsafe_code)]
return Some(unsafe { std::mem::transmute(rule_value) });
return Some(unsafe { std::mem::transmute::<u16, Rule>(rule_value) });
}
self.index += 1;
@ -387,9 +389,10 @@ impl FusedIterator for RuleSetIterator {}
#[cfg(test)]
mod tests {
use crate::registry::{Rule, RuleSet};
use strum::IntoEnumIterator;
use crate::registry::{Rule, RuleSet};
/// Tests that the set can contain all rules
#[test]
fn test_all_rules() {