mirror of
https://github.com/astral-sh/ruff.git
synced 2025-09-29 13:25:17 +00:00
Upgrade to Rust 1.79 (#11875)
This commit is contained in:
parent
355d26f05c
commit
1f654ee729
6 changed files with 10 additions and 10 deletions
|
@ -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() {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue