Fix clippy warnings.
This commit fixes the current set of (stable) clippy warnings in the repo.
This commit is contained in:
committed by
Andrew Brown
parent
1176e4f178
commit
9f506692c2
@@ -25,7 +25,7 @@ pub enum IsaSpec {
|
||||
impl IsaSpec {
|
||||
/// If the `IsaSpec` contains exactly 1 `TargetIsa` we return a reference to it
|
||||
pub fn unique_isa(&self) -> Option<&dyn TargetIsa> {
|
||||
if let IsaSpec::Some(ref isa_vec) = *self {
|
||||
if let Self::Some(ref isa_vec) = *self {
|
||||
if isa_vec.len() == 1 {
|
||||
return Some(&*isa_vec[0]);
|
||||
}
|
||||
|
||||
@@ -461,6 +461,7 @@ impl<'a> Lexer<'a> {
|
||||
/// Get the next token or a lexical error.
|
||||
///
|
||||
/// Return None when the end of the source is encountered.
|
||||
#[allow(clippy::cognitive_complexity)]
|
||||
pub fn next(&mut self) -> Option<Result<LocatedToken<'a>, LocatedError>> {
|
||||
loop {
|
||||
let loc = self.loc();
|
||||
|
||||
@@ -3291,6 +3291,9 @@ mod tests {
|
||||
let c = Parser::new("true false true false")
|
||||
.parse_literals_to_constant_data(B32X4)
|
||||
.unwrap();
|
||||
assert_eq!(c.to_vec(), [1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0])
|
||||
assert_eq!(
|
||||
c.into_vec(),
|
||||
[1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0]
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user