Skip to content

Commit

Permalink
Merge pull request #918 from g-r-a-n-t/satisfy-clippy
Browse files Browse the repository at this point in the history
clippy
  • Loading branch information
g-r-a-n-t authored Aug 25, 2023
2 parents 6ba3f04 + 7fc3716 commit 325daac
Show file tree
Hide file tree
Showing 8 changed files with 8 additions and 3 deletions.
1 change: 1 addition & 0 deletions crates/analyzer/src/db.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#![allow(clippy::arc_with_non_send_sync)]
use crate::namespace::items::{
self, AttributeId, ContractFieldId, ContractId, DepGraphWrapper, EnumVariantKind, FunctionId,
FunctionSigId, ImplId, IngotId, Item, ModuleConstantId, ModuleId, StructFieldId, StructId,
Expand Down
2 changes: 1 addition & 1 deletion crates/analyzer/src/db/queries/module.rs
Original file line number Diff line number Diff line change
Expand Up @@ -560,7 +560,7 @@ pub fn module_used_item_map(
)
.value;

items.extend(Rc::try_unwrap(prelude_items).unwrap().into_iter());
items.extend(Rc::try_unwrap(prelude_items).unwrap());
}

Analysis::new(Rc::new(items), diagnostics.into())
Expand Down
1 change: 1 addition & 0 deletions crates/codegen/src/db.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#![allow(clippy::arc_with_non_send_sync)]
use std::rc::Rc;

use fe_abi::{contract::AbiContract, event::AbiEvent, function::AbiFunction, types::AbiType};
Expand Down
2 changes: 1 addition & 1 deletion crates/codegen/src/yul/runtime/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -383,7 +383,7 @@ impl RuntimeProvider for DefaultRuntimeProvider {
}

let deref_ty = ptr_ty.deref(db.upcast());
let args = std::iter::once(ptr).chain(args.into_iter()).collect();
let args = std::iter::once(ptr).chain(args).collect();
let legalized_ty = db.codegen_legalized_type(ptr_ty);
if deref_ty.is_enum(db.upcast()) {
let mut name = format!("enum_init_{}", ptr_ty.0);
Expand Down
1 change: 1 addition & 0 deletions crates/common/src/db.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#![allow(clippy::arc_with_non_send_sync)]
use crate::files::{File, SourceFileId, Utf8Path};
use codespan_reporting as cs;
use salsa;
Expand Down
1 change: 1 addition & 0 deletions crates/mir/src/db.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#![allow(clippy::arc_with_non_send_sync)]
use std::{collections::BTreeMap, rc::Rc};

use fe_analyzer::{
Expand Down
2 changes: 1 addition & 1 deletion crates/mir/src/lower/function.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1082,7 +1082,7 @@ impl<'db, 'a> BodyLowerHelper<'db, 'a> {
let enum_args = if data_ty.is_unit(self.db) {
vec![tag, self.make_unit()]
} else {
std::iter::once(tag).chain(args.into_iter()).collect()
std::iter::once(tag).chain(args).collect()
};
self.builder.aggregate_construct(ty, enum_args, source)
}
Expand Down
1 change: 1 addition & 0 deletions crates/parser/src/grammar/types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ pub fn parse_struct_def(
))
}

#[allow(clippy::unnecessary_literal_unwrap)]
/// Parse a [`ModuleStmt::Enum`].
/// # Panics
/// Panics if the next token isn't [`TokenKind::Enum`].
Expand Down

0 comments on commit 325daac

Please sign in to comment.