Skip to content

Commit

Permalink
Merge #38
Browse files Browse the repository at this point in the history
38: Lint on unused r=matklad a=CAD97

Piecewise improvement to replace the wholesale refactor that is #35.

Re-enables `#[warn(unused)]` and fixes the resulting fallout.

Co-authored-by: cad97 <cad97@cad97.com>
  • Loading branch information
bors[bot] and CAD97 authored Nov 19, 2019
2 parents 9815b35 + d43120c commit dac5a51
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 15 deletions.
10 changes: 4 additions & 6 deletions src/cursor.rs
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
use std::{
cell::{Cell, RefCell},
cell::RefCell,
fmt,
hash::{Hash, Hasher},
iter,
marker::PhantomData,
mem, ptr,
iter, mem, ptr,
rc::Rc,
slice,
};
Expand Down Expand Up @@ -594,7 +592,7 @@ impl SyntaxToken {
.children_to(self.index as usize, self.text_range().start())
.next()?;

Some(NodeOrToken::new(element, self.parent(), index as u32, offset))
Some(NodeOrToken::new(element, parent, index as u32, offset))
}

pub fn siblings_with_tokens(
Expand Down Expand Up @@ -733,7 +731,7 @@ impl Iter {
Iter { parent, green, offset, index: 0 }
}

fn next(&mut self) -> Option<((&GreenElement, u32, TextUnit))> {
fn next(&mut self) -> Option<(&GreenElement, u32, TextUnit)> {
self.green.next().map(|element| {
let offset = self.offset;
let index = self.index;
Expand Down
1 change: 0 additions & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
// missing_docs,
)]
#![deny(unsafe_code)]
#![allow(unused)]

mod green;
#[allow(unsafe_code)]
Expand Down
7 changes: 3 additions & 4 deletions src/syntax_text.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
use std::{fmt, ops};
use std::fmt;

use crate::{
cursor::{SyntaxElement, SyntaxNode, SyntaxToken},
NodeOrToken, SmolStr, TextRange, TextUnit,
cursor::{SyntaxNode, SyntaxToken},
TextRange, TextUnit,
};

#[derive(Clone)]
Expand Down Expand Up @@ -191,7 +191,6 @@ fn zip_texts<I: Iterator<Item = (SyntaxToken, TextRange)>>(xs: &mut I, ys: &mut
x.1 = TextRange::from_to(x.1.start() + advance, x.1.end());
y.1 = TextRange::from_to(y.1.start() + advance, y.1.end());
}
None
}

impl Eq for SyntaxText {}
Expand Down
4 changes: 0 additions & 4 deletions src/utility_types.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
use std::{iter, ops::Range};

use crate::{TextRange, TextUnit};

#[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)]
pub enum NodeOrToken<N, T> {
Node(N),
Expand Down

0 comments on commit dac5a51

Please sign in to comment.