Skip to content

Commit

Permalink
Add Box<str> impl - closes #220
Browse files Browse the repository at this point in the history
  • Loading branch information
oscartbeaumont committed Mar 17, 2024
1 parent 5da3e56 commit 2d02e8a
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/type/impls.rs
Expand Up @@ -27,6 +27,10 @@ impl<'a> Type for &'a str {
impl_passthrough!(String);
}

impl Type for Box<str> {
impl_passthrough!(String);
}

impl<'a, T: Type + 'static> Type for &'a T {
impl_passthrough!(T);
}
Expand Down
3 changes: 3 additions & 0 deletions tests/ts.rs
Expand Up @@ -300,6 +300,9 @@ fn typescript_types() {
InlineTuple2,
r#"{ demo: [{ demo: [string, boolean] }, boolean] }"#
);

// https://github.com/oscartbeaumont/specta/issues/220
assert_ts!(Box<str>, r#"string"#);
}

#[derive(Type)]
Expand Down

0 comments on commit 2d02e8a

Please sign in to comment.