Skip to content

Commit 0f85c06

Browse files
committed
fix fmt
1 parent d413863 commit 0f85c06

File tree

14 files changed

+137
-152
lines changed

14 files changed

+137
-152
lines changed

crates/ast_node/src/encoding/decode.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
use syn::{spanned::Spanned, Data, DeriveInput};
22

3-
use super::{is_unknown, is_with, is_ignore, EnumType};
3+
use super::{is_ignore, is_unknown, is_with, EnumType};
44

55
pub fn expand(DeriveInput { ident, data, .. }: DeriveInput) -> syn::ItemImpl {
66
match data {

crates/ast_node/src/encoding/encode.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
use syn::{spanned::Spanned, Data, DeriveInput};
22

3-
use super::{is_unknown, is_with, is_ignore, EnumType};
3+
use super::{is_ignore, is_unknown, is_with, EnumType};
44

55
pub fn expand(DeriveInput { ident, data, .. }: DeriveInput) -> syn::ItemImpl {
66
match data {

crates/swc_common/src/comments.rs

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -636,10 +636,7 @@ impl SingleThreadedComments {
636636
)]
637637
#[cfg_attr(feature = "rkyv-impl", derive(bytecheck::CheckBytes))]
638638
#[cfg_attr(feature = "rkyv-impl", repr(C))]
639-
#[cfg_attr(
640-
feature = "encoding-impl",
641-
derive(crate::Encode, crate::Decode)
642-
)]
639+
#[cfg_attr(feature = "encoding-impl", derive(crate::Encode, crate::Decode))]
643640
pub struct Comment {
644641
pub kind: CommentKind,
645642
pub span: Span,
@@ -660,10 +657,7 @@ impl Spanned for Comment {
660657
)]
661658
#[cfg_attr(feature = "rkyv-impl", derive(bytecheck::CheckBytes))]
662659
#[cfg_attr(feature = "rkyv-impl", repr(u32))]
663-
#[cfg_attr(
664-
feature = "encoding-impl",
665-
derive(crate::Encode, crate::Decode)
666-
)]
660+
#[cfg_attr(feature = "encoding-impl", derive(crate::Encode, crate::Decode))]
667661
pub enum CommentKind {
668662
Line = 0,
669663
Block = 1,

crates/swc_common/src/plugin/emit.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
21
#[derive(Debug, Clone, PartialEq, Eq)]
32
#[cfg_attr(
43
feature = "encoding-impl",

crates/swc_common/src/plugin/metadata.rs

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ impl cbor4ii::core::enc::Encode for Context {
8888
k.encode(writer)?;
8989
v.encode(writer)?;
9090
}
91-
91+
9292
Ok(())
9393
}
9494
}
@@ -101,11 +101,10 @@ impl<'de> cbor4ii::core::dec::Decode<'de> for Context {
101101
) -> Result<Self, cbor4ii::core::dec::Error<R::Error>> {
102102
use cbor4ii::core::types;
103103

104-
let len = types::Map::len(reader)?
105-
.ok_or_else(|| cbor4ii::core::dec::Error::Mismatch {
106-
name: &"Context",
107-
found: 0
108-
})?;
104+
let len = types::Map::len(reader)?.ok_or_else(|| cbor4ii::core::dec::Error::Mismatch {
105+
name: &"Context",
106+
found: 0,
107+
})?;
109108
let len = std::cmp::min(len, 4 * 1024);
110109
let mut map = FxHashMap::with_capacity_and_hasher(len, Default::default());
111110
for _ in 0..len {
@@ -114,7 +113,6 @@ impl<'de> cbor4ii::core::dec::Decode<'de> for Context {
114113
map.insert(k, v);
115114
}
116115

117-
Ok(Context(map))
116+
Ok(Context(map))
118117
}
119118
}
120-

crates/swc_common/src/plugin/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
pub mod diagnostics;
2-
pub mod metadata;
32
pub mod emit;
3+
pub mod metadata;
44
#[cfg(feature = "__plugin")]
55
#[cfg_attr(docsrs, doc(cfg(feature = "__plugin")))]
66
pub mod serialized;

crates/swc_common/src/plugin/serialized.rs

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,7 @@ use anyhow::Error;
1616
/// or plugin_macro. Plugin's transform fn itself does not allow to return
1717
/// error - instead it should use provided `handler` to emit corresponding error
1818
/// to the host.
19-
#[cfg_attr(
20-
feature = "encoding-impl",
21-
derive(crate::Encode, crate::Decode)
22-
)]
19+
#[cfg_attr(feature = "encoding-impl", derive(crate::Encode, crate::Decode))]
2320
pub enum PluginError {
2421
/// Occurs when failed to convert size passed from host / guest into usize
2522
/// or similar for the conversion. This is an internal error rasied via
@@ -90,7 +87,7 @@ impl PluginSerializedBytes {
9087
let mut buf = cbor4ii::core::utils::BufWriter::new(Vec::new());
9188
t.0.encode(&mut buf)?;
9289
Ok(PluginSerializedBytes {
93-
field: buf.into_inner()
90+
field: buf.into_inner(),
9491
})
9592
}
9693

@@ -199,10 +196,10 @@ where
199196
writer: &mut W,
200197
) -> Result<(), cbor4ii::core::enc::Error<W::Error>> {
201198
use cbor4ii::core::types::Tag;
202-
199+
203200
match &self.0 {
204201
Ok(t) => Tag(1, t).encode(writer),
205-
Err(t) => Tag(0, t).encode(writer)
202+
Err(t) => Tag(0, t).encode(writer),
206203
}
207204
}
208205
}
@@ -222,8 +219,8 @@ where
222219
0 => E::decode(reader).map(Result::Err).map(ResultValue),
223220
1 => T::decode(reader).map(Result::Ok).map(ResultValue),
224221
_ => Err(cbor4ii::core::error::DecodeError::Mismatch {
225-
name: &"ResultValue",
226-
found: tag.to_le_bytes()[0]
222+
name: &"ResultValue",
223+
found: tag.to_le_bytes()[0],
227224
}),
228225
}
229226
}

0 commit comments

Comments
 (0)