Trim space off the return type before continuing (#1487)

* Trim space off the return type before continuing

My nightly compiler has a space at the end that the stable compiler
doesn't. This will trim space, if it exists, before removing the generic
bracket, which will work for both stable and current nightly, future
stable.

In the future this may be worth doing a trim on "> " but I don't reckon
today is that day.

Signed-off-by: Paul R. Tagliamonte <paul@kittycad.io>
This commit is contained in:
Paul Tagliamonte
2024-02-22 12:59:51 -08:00
committed by GitHub
parent 8dab5527b8
commit fccf3508a7
2 changed files with 1 additions and 0 deletions

View File

@ -233,6 +233,7 @@ fn do_stdlib_inner(
let ret_ty_string = if ret_ty_string.starts_with("Box <") {
ret_ty_string
.trim_start_matches("Box <")
.trim_end_matches(' ')
.trim_end_matches('>')
.trim()
.to_string()