Skip to content

Commit 56cc33a

Browse files
refactor: review code with clippy
1 parent 2a55cb9 commit 56cc33a

File tree

10 files changed

+76
-91
lines changed

10 files changed

+76
-91
lines changed

src/anonymous.rs

+9-25
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ impl<'a, T> AnonymousBinding<'a, T> {
1414
}
1515
}
1616

17-
impl<'a, I: Interpretation, V: Vocabulary, T> LinkedDataResource<I, V> for AnonymousBinding<'a, T> {
17+
impl<I: Interpretation, V: Vocabulary, T> LinkedDataResource<I, V> for AnonymousBinding<'_, T> {
1818
fn interpretation(
1919
&self,
2020
_vocabulary: &mut V,
@@ -24,12 +24,8 @@ impl<'a, I: Interpretation, V: Vocabulary, T> LinkedDataResource<I, V> for Anony
2424
}
2525
}
2626

27-
impl<
28-
'a,
29-
V: Vocabulary + IriVocabularyMut,
30-
I: Interpretation,
31-
T: LinkedDataPredicateObjects<I, V>,
32-
> LinkedDataSubject<I, V> for AnonymousBinding<'a, T>
27+
impl<V: Vocabulary + IriVocabularyMut, I: Interpretation, T: LinkedDataPredicateObjects<I, V>>
28+
LinkedDataSubject<I, V> for AnonymousBinding<'_, T>
3329
{
3430
fn visit_subject<S>(&self, mut serializer: S) -> Result<S::Ok, S::Error>
3531
where
@@ -40,12 +36,8 @@ impl<
4036
}
4137
}
4238

43-
impl<
44-
'a,
45-
V: Vocabulary + IriVocabularyMut,
46-
I: Interpretation,
47-
T: LinkedDataPredicateObjects<I, V>,
48-
> LinkedDataPredicateObjects<I, V> for AnonymousBinding<'a, T>
39+
impl<V: Vocabulary + IriVocabularyMut, I: Interpretation, T: LinkedDataPredicateObjects<I, V>>
40+
LinkedDataPredicateObjects<I, V> for AnonymousBinding<'_, T>
4941
{
5042
fn visit_objects<S>(&self, mut serializer: S) -> Result<S::Ok, S::Error>
5143
where
@@ -56,12 +48,8 @@ impl<
5648
}
5749
}
5850

59-
impl<
60-
'a,
61-
V: Vocabulary + IriVocabularyMut,
62-
I: Interpretation,
63-
T: LinkedDataPredicateObjects<I, V>,
64-
> LinkedDataGraph<I, V> for AnonymousBinding<'a, T>
51+
impl<V: Vocabulary + IriVocabularyMut, I: Interpretation, T: LinkedDataPredicateObjects<I, V>>
52+
LinkedDataGraph<I, V> for AnonymousBinding<'_, T>
6553
{
6654
fn visit_graph<S>(&self, mut serializer: S) -> Result<S::Ok, S::Error>
6755
where
@@ -72,12 +60,8 @@ impl<
7260
}
7361
}
7462

75-
impl<
76-
'a,
77-
V: Vocabulary + IriVocabularyMut,
78-
I: Interpretation,
79-
T: LinkedDataPredicateObjects<I, V>,
80-
> LinkedData<I, V> for AnonymousBinding<'a, T>
63+
impl<V: Vocabulary + IriVocabularyMut, I: Interpretation, T: LinkedDataPredicateObjects<I, V>>
64+
LinkedData<I, V> for AnonymousBinding<'_, T>
8165
{
8266
fn visit<S>(&self, mut serializer: S) -> Result<S::Ok, S::Error>
8367
where

src/graph.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@ impl<I: Interpretation, V: Vocabulary> LinkedDataGraph<I, V> for () {
2121
}
2222
}
2323

24-
impl<'a, I: Interpretation, V: Vocabulary, T: ?Sized + LinkedDataGraph<I, V>> LinkedDataGraph<I, V>
25-
for &'a T
24+
impl<I: Interpretation, V: Vocabulary, T: ?Sized + LinkedDataGraph<I, V>> LinkedDataGraph<I, V>
25+
for &T
2626
{
2727
fn visit_graph<S>(&self, visitor: S) -> Result<S::Ok, S::Error>
2828
where
@@ -100,7 +100,7 @@ pub trait GraphVisitor<I: Interpretation, V: Vocabulary> {
100100
fn end(self) -> Result<Self::Ok, Self::Error>;
101101
}
102102

103-
impl<'a, I: Interpretation, V: Vocabulary, S: GraphVisitor<I, V>> GraphVisitor<I, V> for &'a mut S {
103+
impl<I: Interpretation, V: Vocabulary, S: GraphVisitor<I, V>> GraphVisitor<I, V> for &mut S {
104104
type Ok = ();
105105
type Error = S::Error;
106106

src/impl/rdf_types/dataset_graph_view.rs

+7-7
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ use crate::{
99
ResourceInterpretation, SubjectVisitor,
1010
};
1111

12-
impl<'a, I: Interpretation, V: Vocabulary, D> LinkedDataSubject<I, V> for DatasetGraphView<'a, D>
12+
impl<I: Interpretation, V: Vocabulary, D> LinkedDataSubject<I, V> for DatasetGraphView<'_, D>
1313
where
1414
I::Resource: Eq + Hash + LinkedDataResource<I, V>,
1515
D: PredicateTraversableDataset<Resource = I::Resource> + PatternMatchingDataset,
@@ -35,8 +35,8 @@ struct PredicateObjects<'d, 'v, D: Dataset> {
3535
visited: &'v im::HashSet<&'d D::Resource>,
3636
}
3737

38-
impl<'d, 'v, I: Interpretation, V: Vocabulary, D> LinkedDataPredicateObjects<I, V>
39-
for PredicateObjects<'d, 'v, D>
38+
impl<I: Interpretation, V: Vocabulary, D> LinkedDataPredicateObjects<I, V>
39+
for PredicateObjects<'_, '_, D>
4040
where
4141
I::Resource: Eq + Hash + LinkedDataResource<I, V>,
4242
D: PredicateTraversableDataset<Resource = I::Resource> + PatternMatchingDataset,
@@ -61,8 +61,8 @@ where
6161
}
6262
}
6363

64-
impl<'a, 'v, I: Interpretation, V: Vocabulary, D: Dataset<Resource = I::Resource>>
65-
LinkedDataResource<I, V> for Object<'a, 'v, D>
64+
impl<I: Interpretation, V: Vocabulary, D: Dataset<Resource = I::Resource>> LinkedDataResource<I, V>
65+
for Object<'_, '_, D>
6666
where
6767
I::Resource: LinkedDataResource<I, V>,
6868
{
@@ -82,7 +82,7 @@ struct Object<'d, 'v, D: Dataset> {
8282
visited: &'v im::HashSet<&'d D::Resource>,
8383
}
8484

85-
impl<'d, 'v, I: Interpretation, V: Vocabulary, D> LinkedDataSubject<I, V> for Object<'d, 'v, D>
85+
impl<I: Interpretation, V: Vocabulary, D> LinkedDataSubject<I, V> for Object<'_, '_, D>
8686
where
8787
I::Resource: Eq + Hash + LinkedDataResource<I, V>,
8888
D: PredicateTraversableDataset<Resource = I::Resource> + PatternMatchingDataset,
@@ -161,7 +161,7 @@ impl<'d, 'v, D: PredicateTraversableDataset + PatternMatchingDataset> Subject<'d
161161
}
162162
}
163163

164-
impl<'d, 'v, I: Interpretation, V: Vocabulary, D> LinkedDataSubject<I, V> for Subject<'d, 'v, D>
164+
impl<I: Interpretation, V: Vocabulary, D> LinkedDataSubject<I, V> for Subject<'_, '_, D>
165165
where
166166
D::Resource: Eq + Hash + LinkedDataResource<I, V>,
167167
D: PredicateTraversableDataset<Resource = I::Resource> + PatternMatchingDataset,

src/impl/rdf_types/dataset_view.rs

+9-11
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ use rdf_types::{
1111
Dataset, Interpretation, Quad, Vocabulary,
1212
};
1313

14-
impl<'a, I: Interpretation, V: Vocabulary, D> LinkedDataGraph<I, V> for DatasetView<'a, D>
14+
impl<I: Interpretation, V: Vocabulary, D> LinkedDataGraph<I, V> for DatasetView<'_, D>
1515
where
1616
I::Resource: Eq + Hash + LinkedDataResource<I, V>,
1717
D: SubjectTraversableDataset<Resource = I::Resource>
@@ -67,8 +67,8 @@ struct PredicateObjects<'d, 'v, D: Dataset> {
6767
visited_graphs: &'v im::HashSet<&'d D::Resource>,
6868
}
6969

70-
impl<'d, 'v, I: Interpretation, V: Vocabulary, D> LinkedDataPredicateObjects<I, V>
71-
for PredicateObjects<'d, 'v, D>
70+
impl<I: Interpretation, V: Vocabulary, D> LinkedDataPredicateObjects<I, V>
71+
for PredicateObjects<'_, '_, D>
7272
where
7373
I::Resource: Eq + Hash + LinkedDataResource<I, V>,
7474
D: SubjectTraversableDataset<Resource = I::Resource>
@@ -96,7 +96,7 @@ where
9696
}
9797
}
9898

99-
impl<'a, 'v, D, I: Interpretation, V: Vocabulary> LinkedDataResource<I, V> for Object<'a, 'v, D>
99+
impl<D, I: Interpretation, V: Vocabulary> LinkedDataResource<I, V> for Object<'_, '_, D>
100100
where
101101
I::Resource: LinkedDataResource<I, V>,
102102
D: Dataset<Resource = I::Resource>,
@@ -118,7 +118,7 @@ struct Object<'a, 'v, D: Dataset> {
118118
visited_graphs: &'v im::HashSet<&'a D::Resource>,
119119
}
120120

121-
impl<'a, 'v, I: Interpretation, V: Vocabulary, D> LinkedDataSubject<I, V> for Object<'a, 'v, D>
121+
impl<I: Interpretation, V: Vocabulary, D> LinkedDataSubject<I, V> for Object<'_, '_, D>
122122
where
123123
I::Resource: Eq + Hash + LinkedDataResource<I, V>,
124124
D: SubjectTraversableDataset
@@ -225,7 +225,7 @@ where
225225
}
226226
}
227227

228-
impl<'a, 'v, I: Interpretation, V: Vocabulary, D> LinkedDataResource<I, V> for Subject<'a, 'v, D>
228+
impl<I: Interpretation, V: Vocabulary, D> LinkedDataResource<I, V> for Subject<'_, '_, D>
229229
where
230230
I::Resource: LinkedDataResource<I, V>,
231231
D: Dataset<Resource = I::Resource>,
@@ -239,7 +239,7 @@ where
239239
}
240240
}
241241

242-
impl<'a, 'v, I: Interpretation, V: Vocabulary, D> LinkedDataSubject<I, V> for Subject<'a, 'v, D>
242+
impl<I: Interpretation, V: Vocabulary, D> LinkedDataSubject<I, V> for Subject<'_, '_, D>
243243
where
244244
I::Resource: Eq + Hash + LinkedDataResource<I, V>,
245245
D: SubjectTraversableDataset<Resource = I::Resource>
@@ -277,8 +277,7 @@ struct NamedGraphView<'a, 'v, D: Dataset> {
277277
visited_graphs: &'v im::HashSet<&'a D::Resource>,
278278
}
279279

280-
impl<'a, 'v, I: Interpretation, V: Vocabulary, D> LinkedDataResource<I, V>
281-
for NamedGraphView<'a, 'v, D>
280+
impl<I: Interpretation, V: Vocabulary, D> LinkedDataResource<I, V> for NamedGraphView<'_, '_, D>
282281
where
283282
I::Resource: LinkedDataResource<I, V>,
284283
D: Dataset<Resource = I::Resource>,
@@ -292,8 +291,7 @@ where
292291
}
293292
}
294293

295-
impl<'a, 'v, I: Interpretation, V: Vocabulary, D> LinkedDataGraph<I, V>
296-
for NamedGraphView<'a, 'v, D>
294+
impl<I: Interpretation, V: Vocabulary, D> LinkedDataGraph<I, V> for NamedGraphView<'_, '_, D>
297295
where
298296
I::Resource: Eq + Hash + LinkedDataResource<I, V>,
299297
D: SubjectTraversableDataset<Resource = I::Resource>

src/lib.rs

+4-6
Original file line numberDiff line numberDiff line change
@@ -166,9 +166,7 @@ pub trait LinkedData<I: Interpretation = (), V: Vocabulary = ()> {
166166
S: Visitor<I, V>;
167167
}
168168

169-
impl<'a, I: Interpretation, V: Vocabulary, T: ?Sized + LinkedData<I, V>> LinkedData<I, V>
170-
for &'a T
171-
{
169+
impl<I: Interpretation, V: Vocabulary, T: ?Sized + LinkedData<I, V>> LinkedData<I, V> for &T {
172170
fn visit<S>(&self, visitor: S) -> Result<S::Ok, S::Error>
173171
where
174172
S: Visitor<I, V>,
@@ -219,7 +217,7 @@ pub trait Visitor<I: Interpretation = (), V: Vocabulary = ()> {
219217
}
220218

221219
/// Any mutable reference to a visitor is itself a visitor.
222-
impl<'s, I: Interpretation, V: Vocabulary, S: Visitor<I, V>> Visitor<I, V> for &'s mut S {
220+
impl<I: Interpretation, V: Vocabulary, S: Visitor<I, V>> Visitor<I, V> for &mut S {
223221
type Ok = ();
224222
type Error = S::Error;
225223

@@ -250,7 +248,7 @@ pub enum ResourceOrIriRef<'a, I: Interpretation> {
250248
Anonymous,
251249
}
252250

253-
impl<'a, I: Interpretation> ResourceOrIriRef<'a, I> {
251+
impl<I: Interpretation> ResourceOrIriRef<'_, I> {
254252
pub fn into_iri<V>(self, vocabulary: &V, interpretation: &I) -> Option<IriBuf>
255253
where
256254
V: IriVocabulary,
@@ -347,7 +345,7 @@ pub enum ContextIris {
347345
},
348346
}
349347

350-
impl<'a, I: Interpretation> Default for Context<'a, I> {
348+
impl<I: Interpretation> Default for Context<'_, I> {
351349
fn default() -> Self {
352350
Self::Subject
353351
}

src/predicate.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,8 @@ impl<I: Interpretation, V: Vocabulary> LinkedDataPredicateObjects<I, V> for () {
2929
}
3030
}
3131

32-
impl<'a, I: Interpretation, V: Vocabulary, T: ?Sized + LinkedDataPredicateObjects<I, V>>
33-
LinkedDataPredicateObjects<I, V> for &'a T
32+
impl<I: Interpretation, V: Vocabulary, T: ?Sized + LinkedDataPredicateObjects<I, V>>
33+
LinkedDataPredicateObjects<I, V> for &T
3434
{
3535
fn visit_objects<S>(&self, visitor: S) -> Result<S::Ok, S::Error>
3636
where

0 commit comments

Comments
 (0)