Skip to content

Commit e682505

Browse files
committed
clipclop
1 parent 44e68f8 commit e682505

File tree

9 files changed

+68
-44
lines changed

9 files changed

+68
-44
lines changed

autosurgeon-derive/src/reconcile/enum_impl.rs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ impl<'a> TryFrom<&'a syn::Variant> for Variant<'a> {
6262
}
6363
}
6464

65-
impl<'a> Variant<'a> {
65+
impl Variant<'_> {
6666
fn match_arm(
6767
&self,
6868
reconciler_ident: &syn::Ident,
@@ -155,7 +155,7 @@ enum EnumKeyInnerType<'a> {
155155
NoInnerKeyTuple,
156156
}
157157

158-
impl<'a> EnumKeyInnerType<'a> {
158+
impl EnumKeyInnerType<'_> {
159159
fn get_key(&self, key_type_name: &syn::Ident, variant_name: &syn::Ident) -> TokenStream {
160160
match self {
161161
Self::Unit => {
@@ -340,7 +340,7 @@ struct EnumKeyVariant<'a> {
340340
ty: EnumKeyInnerType<'a>,
341341
}
342342

343-
impl<'a> EnumKeyVariant<'a> {
343+
impl EnumKeyVariant<'_> {
344344
fn non_unit_match_arm(
345345
&self,
346346
outer_name: &syn::Ident,
@@ -642,7 +642,7 @@ struct EnumUnnamedField<'a> {
642642
attrs: attrs::Field,
643643
}
644644

645-
impl<'a> VariantField for EnumUnnamedField<'a> {
645+
impl VariantField for EnumUnnamedField<'_> {
646646
fn name(&self) -> syn::Ident {
647647
format_ident!("field_{}", self.idx)
648648
}
@@ -652,13 +652,13 @@ impl<'a> VariantField for EnumUnnamedField<'a> {
652652
}
653653
}
654654

655-
impl<'a> EnumUnnamedField<'a> {
655+
impl EnumUnnamedField<'_> {
656656
fn name(&self) -> syn::Ident {
657657
format_ident!("field_{}", self.idx)
658658
}
659659
}
660660

661-
impl<'a> Field for EnumUnnamedField<'a> {
661+
impl Field for EnumUnnamedField<'_> {
662662
fn attrs(&self) -> &[syn::Attribute] {
663663
&self.field.attrs
664664
}
@@ -699,7 +699,7 @@ struct EnumNamedField<'a> {
699699
name: &'a syn::Ident,
700700
}
701701

702-
impl<'a> VariantField for EnumNamedField<'a> {
702+
impl VariantField for EnumNamedField<'_> {
703703
fn name(&self) -> syn::Ident {
704704
self.name.clone()
705705
}

autosurgeon-derive/src/reconcile/struct_impl.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ impl<'a> NamedField<'a> {
139139
}
140140
}
141141

142-
impl<'a> Field for NamedField<'a> {
142+
impl Field for NamedField<'_> {
143143
fn attrs(&self) -> &[syn::Attribute] {
144144
&self.field.attrs
145145
}
@@ -202,7 +202,7 @@ impl<'a> TupleField<'a> {
202202
}
203203
}
204204

205-
impl<'a> Field for TupleField<'a> {
205+
impl Field for TupleField<'_> {
206206
fn attrs(&self) -> &[syn::Attribute] {
207207
&self.field.attrs
208208
}

autosurgeon/src/doc.rs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -135,8 +135,11 @@ impl ReadDoc for am::AutoCommit {
135135
}
136136
}
137137

138-
impl<'a> ReadDoc for am::transaction::Transaction<'a> {
139-
type Parents<'b> = am::Parents<'b> where Self: 'b;
138+
impl ReadDoc for am::transaction::Transaction<'_> {
139+
type Parents<'b>
140+
= am::Parents<'b>
141+
where
142+
Self: 'b;
140143
fn get_heads(&self) -> Vec<am::ChangeHash> {
141144
am::transaction::Transactable::base_heads(self)
142145
}

autosurgeon/src/hydrate/impls.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ impl<T: Hydrate> Hydrate for Option<T> {
100100
}
101101
}
102102

103-
impl<'a, T: Hydrate + Clone> Hydrate for Cow<'a, T> {
103+
impl<T: Hydrate + Clone> Hydrate for Cow<'_, T> {
104104
fn hydrate<D: ReadDoc>(
105105
doc: &D,
106106
obj: &automerge::ObjId,

autosurgeon/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
//! ## Feature Flags
1919
//!
2020
//! * `uuid` - Includes implementations of `Reconcile` and `Hydrate` for the [`Uuid`](https://docs.rs/uuid/latest/uuid/) crate which will
21-
//! reconcile to a [`automerge::ScalarValue::Bytes`]
21+
//! reconcile to a [`automerge::ScalarValue::Bytes`]
2222
//!
2323
//! ## Example
2424
//!

autosurgeon/src/prop.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ pub enum Prop<'a> {
77
Index(u32),
88
}
99

10-
impl<'a> std::fmt::Display for Prop<'a> {
10+
impl std::fmt::Display for Prop<'_> {
1111
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
1212
match self {
1313
Self::Key(s) => write!(f, "{}", s),
@@ -16,7 +16,7 @@ impl<'a> std::fmt::Display for Prop<'a> {
1616
}
1717
}
1818

19-
impl<'a> From<&Prop<'a>> for automerge::Prop {
19+
impl From<&Prop<'_>> for automerge::Prop {
2020
fn from(p: &Prop) -> Self {
2121
match p {
2222
Prop::Key(k) => automerge::Prop::Map(k.to_string()),
@@ -49,7 +49,7 @@ impl<'a> From<&'a str> for Prop<'a> {
4949
}
5050
}
5151

52-
impl<'a> From<am::Prop> for Prop<'a> {
52+
impl From<am::Prop> for Prop<'_> {
5353
fn from(p: am::Prop) -> Self {
5454
match p {
5555
am::Prop::Map(k) => Prop::Key(Cow::Owned(k)),

autosurgeon/src/reconcile.rs

Lines changed: 46 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -415,14 +415,22 @@ struct RootReconciler<'a, D> {
415415

416416
impl<'a, D: Doc> Reconciler for RootReconciler<'a, D> {
417417
type Error = ReconcileError;
418-
type Map<'b> = InMap<'b, D>
419-
where Self: 'b;
420-
type Seq<'b> = InSeq<'b, D>
421-
where Self: 'b;
422-
type Text<'b> = InText<'b, D>
423-
where Self: 'b;
424-
type Counter<'b> = AtCounter<'b, D>
425-
where Self: 'b;
418+
type Map<'b>
419+
= InMap<'b, D>
420+
where
421+
Self: 'b;
422+
type Seq<'b>
423+
= InSeq<'b, D>
424+
where
425+
Self: 'b;
426+
type Text<'b>
427+
= InText<'b, D>
428+
where
429+
Self: 'b;
430+
type Counter<'b>
431+
= AtCounter<'b, D>
432+
where
433+
Self: 'b;
426434

427435
fn none(&mut self) -> Result<(), Self::Error> {
428436
Err(ReconcileError::TopLevelNotMap)
@@ -486,7 +494,7 @@ enum PropAction<'a> {
486494
Insert(u32),
487495
}
488496

489-
impl<'a> PropAction<'a> {
497+
impl PropAction<'_> {
490498
fn get_target<'b, D: Doc>(
491499
&self,
492500
doc: &'b D,
@@ -530,16 +538,24 @@ struct PropReconciler<'a, D> {
530538
action: PropAction<'a>,
531539
}
532540

533-
impl<'a, D: Doc> Reconciler for PropReconciler<'a, D> {
541+
impl<D: Doc> Reconciler for PropReconciler<'_, D> {
534542
type Error = ReconcileError;
535-
type Map<'b> = InMap<'b, D>
536-
where Self: 'b;
537-
type Seq<'b> = InSeq<'b, D>
538-
where Self: 'b;
539-
type Text<'b> = InText<'b, D>
540-
where Self: 'b;
541-
type Counter<'b> = AtCounter<'b, D>
542-
where Self: 'b;
543+
type Map<'b>
544+
= InMap<'b, D>
545+
where
546+
Self: 'b;
547+
type Seq<'b>
548+
= InSeq<'b, D>
549+
where
550+
Self: 'b;
551+
type Text<'b>
552+
= InText<'b, D>
553+
where
554+
Self: 'b;
555+
type Counter<'b>
556+
= AtCounter<'b, D>
557+
where
558+
Self: 'b;
543559

544560
fn none(&mut self) -> Result<(), Self::Error> {
545561
self.action
@@ -659,7 +675,7 @@ struct AtCounter<'a, D> {
659675
action: &'a PropAction<'a>,
660676
}
661677

662-
impl<'a, D: Doc> CounterReconciler for AtCounter<'a, D> {
678+
impl<D: Doc> CounterReconciler for AtCounter<'_, D> {
663679
type Error = ReconcileError;
664680

665681
fn increment(&mut self, by: i64) -> Result<(), Self::Error> {
@@ -703,10 +719,12 @@ struct InMap<'a, D> {
703719
current_obj: automerge::ObjId,
704720
}
705721

706-
impl<'a, D: Doc> MapReconciler for InMap<'a, D> {
722+
impl<D: Doc> MapReconciler for InMap<'_, D> {
707723
type Error = ReconcileError;
708-
type EntriesIter<'b> = InMapEntries<'b>
709-
where Self: 'b;
724+
type EntriesIter<'b>
725+
= InMapEntries<'b>
726+
where
727+
Self: 'b;
710728

711729
fn entries(&self) -> Self::EntriesIter<'_> {
712730
InMapEntries {
@@ -779,10 +797,12 @@ impl<'a> Iterator for ItemsInSeq<'a> {
779797
}
780798
}
781799

782-
impl<'a, D: Doc> SeqReconciler for InSeq<'a, D> {
800+
impl<D: Doc> SeqReconciler for InSeq<'_, D> {
783801
type Error = ReconcileError;
784-
type ItemIter<'b> = ItemsInSeq<'b>
785-
where Self: 'b;
802+
type ItemIter<'b>
803+
= ItemsInSeq<'b>
804+
where
805+
Self: 'b;
786806

787807
fn items<'b>(&'_ self) -> Self::ItemIter<'_> {
788808
ItemsInSeq {
@@ -844,7 +864,7 @@ struct InText<'a, D> {
844864
obj: automerge::ObjId,
845865
}
846866

847-
impl<'a, D: Doc> TextReconciler for InText<'a, D> {
867+
impl<D: Doc> TextReconciler for InText<'_, D> {
848868
type Error = ReconcileError;
849869

850870
fn splice<S: AsRef<str>>(

autosurgeon/src/reconcile/impls.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ impl Reconcile for str {
5656
}
5757
}
5858

59-
impl<'a, T: Reconcile + ?Sized> Reconcile for &'a T {
59+
impl<T: Reconcile + ?Sized> Reconcile for &'_ T {
6060
type Key<'b> = T::Key<'b>;
6161
fn reconcile<R: Reconciler>(&self, reconciler: R) -> Result<(), R::Error> {
6262
(*self).reconcile(reconciler)
@@ -171,6 +171,7 @@ macro_rules! int_impl {
171171
Ok(match doc.get(obj, &prop)? {
172172
Some((Value::Scalar(s), _)) => {
173173
if let ScalarValue::$from(i) = s.as_ref() {
174+
#[allow(irrefutable_let_patterns)]
174175
if let Ok(v) = $ty::try_from(*i) {
175176
LoadKey::Found(v)
176177
} else {

autosurgeon/src/reconcile/seq.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ struct Hook<'a, T, S> {
5858
items: &'a [T],
5959
}
6060

61-
impl<'a, T, S> similar::algorithms::DiffHook for Hook<'a, T, S>
61+
impl<T, S> similar::algorithms::DiffHook for Hook<'_, T, S>
6262
where
6363
T: Reconcile,
6464
S: SeqReconciler,

0 commit comments

Comments
 (0)