|
| 1 | +mod iter; |
1 | 2 | mod reflection; |
2 | 3 |
|
| 4 | +pub use iter::Iter; |
3 | 5 | pub use reflection::Reflection; |
4 | 6 |
|
5 | 7 | pub use Reflection as LinkPathListReflection; |
6 | 8 |
|
7 | | -use pipe_trait::Pipe; |
8 | | -use std::{iter::FusedIterator, path::PathBuf, slice}; |
| 9 | +use std::path::PathBuf; |
9 | 10 |
|
10 | 11 | /// List of different hardlinks to the same file. |
11 | 12 | /// |
@@ -38,67 +39,8 @@ impl LinkPathList { |
38 | 39 | self.0.is_empty() |
39 | 40 | } |
40 | 41 |
|
41 | | - /// Iterate over the paths inside the list. |
42 | | - pub fn iter(&self) -> Iter { |
43 | | - self.0.iter().pipe(Iter) |
44 | | - } |
45 | | - |
46 | 42 | /// Create reflection. |
47 | 43 | pub fn into_reflection(self) -> Reflection { |
48 | 44 | self.into() |
49 | 45 | } |
50 | 46 | } |
51 | | - |
52 | | -/// [Iterator] over the paths inside a [`LinkPathList`]. |
53 | | -#[derive(Debug, Clone)] |
54 | | -pub struct Iter<'a>(slice::Iter<'a, PathBuf>); |
55 | | - |
56 | | -impl<'a> Iterator for Iter<'a> { |
57 | | - type Item = &'a PathBuf; |
58 | | - |
59 | | - #[inline] |
60 | | - fn next(&mut self) -> Option<Self::Item> { |
61 | | - self.0.next() |
62 | | - } |
63 | | - |
64 | | - #[inline] |
65 | | - fn size_hint(&self) -> (usize, Option<usize>) { |
66 | | - self.0.size_hint() |
67 | | - } |
68 | | - |
69 | | - #[inline] |
70 | | - fn count(self) -> usize { |
71 | | - self.0.count() |
72 | | - } |
73 | | - |
74 | | - #[inline] |
75 | | - fn nth(&mut self, n: usize) -> Option<Self::Item> { |
76 | | - self.0.nth(n) |
77 | | - } |
78 | | - |
79 | | - #[inline] |
80 | | - fn last(self) -> Option<Self::Item> { |
81 | | - self.0.last() |
82 | | - } |
83 | | -} |
84 | | - |
85 | | -impl<'a> DoubleEndedIterator for Iter<'a> { |
86 | | - #[inline] |
87 | | - fn next_back(&mut self) -> Option<Self::Item> { |
88 | | - self.0.next_back() |
89 | | - } |
90 | | - |
91 | | - #[inline] |
92 | | - fn nth_back(&mut self, n: usize) -> Option<Self::Item> { |
93 | | - self.0.nth_back(n) |
94 | | - } |
95 | | -} |
96 | | - |
97 | | -impl<'a> ExactSizeIterator for Iter<'a> { |
98 | | - #[inline] |
99 | | - fn len(&self) -> usize { |
100 | | - self.0.len() |
101 | | - } |
102 | | -} |
103 | | - |
104 | | -impl FusedIterator for Iter<'_> {} |
0 commit comments