mirror of
https://github.com/denoland/deno.git
synced 2025-03-03 17:34:47 -05:00
lint(serde_v8): fix "inconsistent struct constructor" (#10227)
This commit is contained in:
parent
204b699be4
commit
043021cbd3
1 changed files with 3 additions and 4 deletions
|
@ -27,9 +27,9 @@ where
|
||||||
/// Wraps other serializers into an enum tagged variant form.
|
/// Wraps other serializers into an enum tagged variant form.
|
||||||
/// Uses {"Variant": ...payload...} for compatibility with serde-json.
|
/// Uses {"Variant": ...payload...} for compatibility with serde-json.
|
||||||
pub struct VariantSerializer<'a, 'b, 'c, S> {
|
pub struct VariantSerializer<'a, 'b, 'c, S> {
|
||||||
variant: &'static str,
|
|
||||||
inner: S,
|
inner: S,
|
||||||
scope: ScopePtr<'a, 'b, 'c>,
|
scope: ScopePtr<'a, 'b, 'c>,
|
||||||
|
variant: &'static str,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl<'a, 'b, 'c, S> VariantSerializer<'a, 'b, 'c, S> {
|
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,
|
inner: S,
|
||||||
) -> Self {
|
) -> Self {
|
||||||
Self {
|
Self {
|
||||||
|
inner,
|
||||||
scope,
|
scope,
|
||||||
variant,
|
variant,
|
||||||
inner,
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -97,7 +97,6 @@ where
|
||||||
}
|
}
|
||||||
|
|
||||||
pub struct ArraySerializer<'a, 'b, 'c> {
|
pub struct ArraySerializer<'a, 'b, 'c> {
|
||||||
// serializer: Serializer<'a, 'b, 'c>,
|
|
||||||
pending: Vec<JsValue<'a>>,
|
pending: Vec<JsValue<'a>>,
|
||||||
scope: ScopePtr<'a, 'b, 'c>,
|
scope: ScopePtr<'a, 'b, 'c>,
|
||||||
}
|
}
|
||||||
|
@ -108,7 +107,7 @@ impl<'a, 'b, 'c> ArraySerializer<'a, 'b, 'c> {
|
||||||
Some(len) => Vec::with_capacity(len),
|
Some(len) => Vec::with_capacity(len),
|
||||||
None => vec![],
|
None => vec![],
|
||||||
};
|
};
|
||||||
Self { scope, pending }
|
Self { pending, scope }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue