mirror of
https://github.com/xazukx/ts-rs.git
synced 2026-11-18 22:30:26 +00:00
format
This commit is contained in:
@@ -72,12 +72,12 @@ fn format_field(
|
||||
|
||||
if type_override.is_none() {
|
||||
dependencies.push(match inline {
|
||||
true => quote!{ dependencies.append(&mut <#ty as ts_rs::TS>::dependencies()); },
|
||||
false => quote!{
|
||||
true => quote! { dependencies.append(&mut <#ty as ts_rs::TS>::dependencies()); },
|
||||
false => quote! {
|
||||
if <#ty as ts_rs::TS>::transparent() {
|
||||
dependencies.append(&mut <#ty as ts_rs::TS>::dependencies());
|
||||
} else {
|
||||
dependencies.push((std::any::TypeId::of::<#ty>(), <#ty as ts_rs::TS>::name()));
|
||||
dependencies.push((std::any::TypeId::of::<#ty>(), <#ty as ts_rs::TS>::name()));
|
||||
}
|
||||
},
|
||||
});
|
||||
|
||||
+1
-1
@@ -124,7 +124,7 @@ pub trait TS: 'static {
|
||||
/// All type ids and typescript names of the types this type depends on.
|
||||
/// This is used for resolving imports when using the `export!` macro.
|
||||
fn dependencies() -> Vec<(TypeId, String)>;
|
||||
|
||||
|
||||
/// `true` if this is a transparent type, e.g tuples or a list.
|
||||
/// This is used for resolving imports when using the `export!` macro.
|
||||
fn transparent() -> bool;
|
||||
|
||||
Reference in New Issue
Block a user