diff options
author | Aaron O'Mullan <aaron.omullan@gmail.com> | 2021-04-18 14:35:06 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-04-18 14:35:06 +0200 |
commit | 043021cbd3b9c26807978d956babcf9f607cfbc2 (patch) | |
tree | 8a37e930356af880199b04014196f04414fc5a3b /serde_v8/src | |
parent | 204b699be4cf88e216572d77ad4cced9ab4748bc (diff) |
lint(serde_v8): fix "inconsistent struct constructor" (#10227)
Diffstat (limited to 'serde_v8/src')
-rw-r--r-- | serde_v8/src/ser.rs | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/serde_v8/src/ser.rs b/serde_v8/src/ser.rs index 126657c6b..e37647053 100644 --- a/serde_v8/src/ser.rs +++ b/serde_v8/src/ser.rs @@ -27,9 +27,9 @@ where /// Wraps other serializers into an enum tagged variant form. /// Uses {"Variant": ...payload...} for compatibility with serde-json. pub struct VariantSerializer<'a, 'b, 'c, S> { - variant: &'static str, inner: S, scope: ScopePtr<'a, 'b, 'c>, + variant: &'static str, } impl<'a, 'b, 'c, S> VariantSerializer<'a, 'b, 'c, S> { @@ -39,9 +39,9 @@ impl<'a, 'b, 'c, S> VariantSerializer<'a, 'b, 'c, S> { inner: S, ) -> Self { Self { + inner, scope, variant, - inner, } } @@ -97,7 +97,6 @@ where } pub struct ArraySerializer<'a, 'b, 'c> { - // serializer: Serializer<'a, 'b, 'c>, pending: Vec<JsValue<'a>>, scope: ScopePtr<'a, 'b, 'c>, } @@ -108,7 +107,7 @@ impl<'a, 'b, 'c> ArraySerializer<'a, 'b, 'c> { Some(len) => Vec::with_capacity(len), None => vec![], }; - Self { scope, pending } + Self { pending, scope } } } |