mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-10-03 07:04:49 +00:00
cargo clippy --fix
This commit is contained in:
parent
1ab8c7fd27
commit
fad4fa163c
178 changed files with 595 additions and 738 deletions
|
@ -191,7 +191,7 @@ impl AstIdMap {
|
|||
|
||||
/// The [`AstId`] of the root node
|
||||
pub fn root(&self) -> SyntaxNodePtr {
|
||||
self.arena[Idx::from_raw(RawIdx::from_u32(0))].clone()
|
||||
self.arena[Idx::from_raw(RawIdx::from_u32(0))]
|
||||
}
|
||||
|
||||
pub fn ast_id<N: AstIdNode>(&self, item: &N) -> FileAstId<N> {
|
||||
|
@ -213,11 +213,11 @@ impl AstIdMap {
|
|||
}
|
||||
|
||||
pub fn get<N: AstIdNode>(&self, id: FileAstId<N>) -> AstPtr<N> {
|
||||
AstPtr::try_from_raw(self.arena[id.raw].clone()).unwrap()
|
||||
AstPtr::try_from_raw(self.arena[id.raw]).unwrap()
|
||||
}
|
||||
|
||||
pub fn get_erased(&self, id: ErasedFileAstId) -> SyntaxNodePtr {
|
||||
self.arena[id].clone()
|
||||
self.arena[id]
|
||||
}
|
||||
|
||||
fn erased_ast_id(&self, item: &SyntaxNode) -> ErasedFileAstId {
|
||||
|
@ -239,9 +239,7 @@ impl AstIdMap {
|
|||
}
|
||||
|
||||
fn hash_ptr(ptr: &SyntaxNodePtr) -> u64 {
|
||||
let mut hasher = BuildHasherDefault::<FxHasher>::default().build_hasher();
|
||||
ptr.hash(&mut hasher);
|
||||
hasher.finish()
|
||||
BuildHasherDefault::<FxHasher>::default().hash_one(ptr)
|
||||
}
|
||||
|
||||
#[derive(Copy, Clone, PartialEq, Eq)]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue