run rustfmt

This commit is contained in:
Alexander Bulaev
2020-03-18 13:59:22 +03:00
parent efe9272816
commit 4630f44d6c
11 changed files with 808 additions and 710 deletions

View File

@ -11,34 +11,34 @@ use crate::{Key, Spline};
/// Iterator over spline keys.
///
/// This iterator type is guaranteed to iterate over sorted keys.
pub struct Iter<'a, T, V> where T: 'a, V: 'a {
spline: &'a Spline<T, V>,
i: usize
pub struct Iter<'a, T, V>
where
T: 'a,
V: 'a,
{
spline: &'a Spline<T, V>,
i: usize,
}
impl<'a, T, V> Iterator for Iter<'a, T, V> {
type Item = &'a Key<T, V>;
type Item = &'a Key<T, V>;
fn next(&mut self) -> Option<Self::Item> {
let r = self.spline.0.get(self.i);
fn next(&mut self) -> Option<Self::Item> {
let r = self.spline.0.get(self.i);
if let Some(_) = r {
self.i += 1;
if let Some(_) = r {
self.i += 1;
}
r
}
r
}
}
impl<'a, T, V> IntoIterator for &'a Spline<T, V> {
type Item = &'a Key<T, V>;
type IntoIter = Iter<'a, T, V>;
type Item = &'a Key<T, V>;
type IntoIter = Iter<'a, T, V>;
fn into_iter(self) -> Self::IntoIter {
Iter {
spline: self,
i: 0
fn into_iter(self) -> Self::IntoIter {
Iter { spline: self, i: 0 }
}
}
}