typeshare icon indicating copy to clipboard operation
typeshare copied to clipboard

Support for constants

Open d4h0 opened this issue 2 years ago • 4 comments

Hi,

I tried the following:

#[typeshare::typeshare]
const SHARED_VAR: &str = "value";

...hoping that I could use this to define some shared constants in one place, but that doesn't seem to be supported.

There also wasn't an error message, which isn't ideal, I think.

d4h0 avatar Dec 24 '22 12:12 d4h0

I think this could be a useful feature! However, we would probably have to limit the scope of this change to numeric and string constants for now.

snowsignal avatar Jan 27 '23 02:01 snowsignal

@InquisitivePenguin: That seem reasonable. Booleans probably also could be supported easily.

d4h0 avatar Jan 27 '23 06:01 d4h0

@InquisitivePenguin any update on your PR? Support for Rust &str constants would be really useful for us, thanks!

dwosk avatar Jun 13 '23 19:06 dwosk

@dwosk Sorry about the delay - support for this should be ready soon.

snowsignal avatar Jul 13 '23 16:07 snowsignal