Aleph-Alpha / ts-rs

Generate TypeScript bindings from Rust types
MIT License
989 stars 99 forks source link

Fix missing case in #299 #310

Closed escritorio-gustavo closed 2 months ago

escritorio-gustavo commented 2 months ago

Goal

In #299, the type_as_infer (now called replace_underscore) function doesn't handle a type Type::Path(TypePath { qself: Some(_), .. }) due to a match on None for the qself field, this PR is a quick fix for that

This allows the following use of as:

#[ts(as = "<_ as Bar>::Baz")]
foo: String

Changes

Removed the match on qself: None and called replace_underscore on qself.ty

Checklist