Closed LouisMPenrod closed 1 month ago
@DavisVaughan do you remember what we've done when we've printed length-0 objects in other packages?
You could use the vctrs approach and always unconditionally print a header
> vctrs::obj_print(1)
<double[1]>
[1] 1
> vctrs::obj_print(double())
<double[0]>
Like <stringr_view[0]>
or something. So even in the empty case you get something.
But since this is mostly for interactive usage I don't mind something like No strings provided
or something equally friendly. I don't really mind the current behavior much though, it is like glue::glue()
.
Do we also want to consider the str_view(character(), html = TRUE)
case?
I consider html = TRUE
basically superseded so no need to worry about it, I think.
Thanks for working on this and I hope you had fun at TDD 😁
Returns a message instead of returning nothing which was the previous behavior. Existing snapshot updated.
Fixes #497