Fix clippy warnings

This commit is contained in:
Alexandre Bury 2018-02-16 17:20:13 -08:00
parent d33fb39cd9
commit 6b6398f109
3 changed files with 9 additions and 5 deletions

View File

@ -50,7 +50,7 @@ impl Segment {
{
let span = spans[self.span_id].as_ref();
if let &IndexedCow::Borrowed { start, .. } = span {
if let IndexedCow::Borrowed { start, .. } = *span {
Some((self.start + start, self.end + start))
} else {
None

View File

@ -23,9 +23,7 @@ where
fn next(&mut self) -> Option<Self::Item> {
if self.current.is_none() {
self.current = self.inner.next();
if self.current.is_none() {
return None;
}
self.current?;
}
loop {

View File

@ -49,6 +49,12 @@ where
r: &'a C,
}
impl<T> Default for SpannedString<T> {
fn default() -> Self {
SpannedString::new()
}
}
impl<'a, T> SpannedText for &'a SpannedString<T> {
type S = IndexedSpan<T>;