Skip to content

Commit

Permalink
fix optional features
Browse files Browse the repository at this point in the history
  • Loading branch information
NyxCode committed Feb 16, 2024
1 parent 29248b4 commit 4264c5f
Show file tree
Hide file tree
Showing 5 changed files with 4 additions and 10 deletions.
6 changes: 0 additions & 6 deletions ts-rs/src/chrono.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,6 @@ impl<T: TimeZone + 'static> TS for DateTime<T> {
fn name() -> String {
"string".to_owned()
}
fn name_with_type_args(_: Vec<String>) -> String {
Self::name()
}
fn inline() -> String {
"string".to_owned()
}
Expand All @@ -40,9 +37,6 @@ impl<T: TimeZone + 'static> TS for Date<T> {
fn name() -> String {
"string".to_owned()
}
fn name_with_type_args(_: Vec<String>) -> String {
Self::name()
}
fn inline() -> String {
"string".to_owned()
}
Expand Down
2 changes: 1 addition & 1 deletion ts-rs/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -421,7 +421,7 @@ macro_rules! impl_primitives {
($($($ty:ty),* => $l:literal),*) => { $($(
impl TS for $ty {
fn name() -> String { $l.to_owned() }
fn inline() -> String { Self::name() }
fn inline() -> String { <Self as $crate::TS>::name() }
fn transparent() -> bool { false }
}
)*)* };
Expand Down
2 changes: 1 addition & 1 deletion ts-rs/tests/chrono.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,6 @@ fn chrono() {

assert_eq!(
Chrono::decl(),
"type Chrono = { date: [string, string, string, string], time: string, date_time: [string, string, string, string], duration: string, month: string, weekday: string, }"
"type Chrono = { date: [string, string, string, string], time: string, date_time: [string, string, string, string], duration: string, month: string, weekday: string, };"
)
}
2 changes: 1 addition & 1 deletion ts-rs/tests/indexmap.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,6 @@ fn indexmap() {

assert_eq!(
Indexes::decl(),
"type Indexes = { map: Record<string, string>, set: Array<string>, }"
"type Indexes = { map: Record<string, string>, set: Array<string>, };"
)
}
2 changes: 1 addition & 1 deletion ts-rs/tests/semver.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,5 @@ fn semver() {
version: Version,
}

assert_eq!(Semver::decl(), "type Semver = { version: string, }")
assert_eq!(Semver::decl(), "type Semver = { version: string, };")
}

0 comments on commit 4264c5f

Please sign in to comment.