Skip to content
This repository was archived by the owner on Jul 6, 2025. It is now read-only.

Commit ef1964a

Browse files
refactor: remove some repitition in match statement
1 parent 3f354ea commit ef1964a

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

compiler/src/source_type.rs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -82,14 +82,14 @@ impl Serialize for SourceType {
8282
S: Serializer,
8383
{
8484
let value = match self {
85-
SourceType::JavaScript => 0 as i32,
86-
SourceType::JSX => 1 as i32,
87-
SourceType::TypeScript => 2 as i32,
88-
SourceType::TSX => 3 as i32,
89-
SourceType::Json => 4 as i32,
90-
SourceType::Wasm => 5 as i32,
91-
SourceType::Unknown => 9 as i32,
92-
};
85+
SourceType::JavaScript => 0,
86+
SourceType::JSX => 1,
87+
SourceType::TypeScript => 2,
88+
SourceType::TSX => 3,
89+
SourceType::Json => 4,
90+
SourceType::Wasm => 5,
91+
SourceType::Unknown => 9,
92+
} as i32;
9393
Serialize::serialize(&value, serializer)
9494
}
9595
}

0 commit comments

Comments
 (0)