When attempting to use the asset! macro as described in documentation here an error is thrown not allowing the usage of image() to specify image format & size of the asset.
20:35:26 [cargo] error: macro expansion ignores token `,` and any following
--> src/main.rs:38:34
|
37 | const AUTUMN_LOGO: Asset = manganis::asset!(
| ________________________________-
38 | | "/assets/autumn-logo.png",
| | ^
39 | | asset::image().format(ImageType::Avif).size(64, 64)
40 | | );
| |_____- caused by the macro expansion here
|
= note: the usage of `manganis::asset!` is likely invalid in expression context
Setting the type of AUTUMN_LOGO to ImageAsset results in mismatched types error, unknown if this is even the intended solution though.
error[E0308]: mismatched types
--> src/main.rs:37:37
|
37 | const AUTUMN_LOGO: ImageAsset = manganis::asset!(
| _____________________________________^
38 | | "/assets/autumn-logo.png",
39 | | asset::image().format(ImageType::Avif).size(64, 64)
40 | | );
| |_____^ expected `ImageAsset`, found `Asset`
|
= note: this error originates in the macro `manganis::asset` (in Nightly builds, run with -Z macro-backtrace for more info)
Steps To Reproduce
Steps to reproduce the behavior:
Use asset! macro with image() to specify image format & size
Problem
When attempting to use the
asset!
macro as described in documentation here an error is thrown not allowing the usage of image() to specify image format & size of the asset.Setting the type of
AUTUMN_LOGO
toImageAsset
results in mismatched types error, unknown if this is even the intended solution though.Steps To Reproduce
Steps to reproduce the behavior:
This GitHub repo is a minimal example of where this bug can be replicated.
Environment:
Questionnaire
I'm interested in fixing this myself but don't know where to start