compiler: Do not fail the embed_images pass with URLs

Slintpad uses URLs to images. Do not fail when we "embed"
those so that we find the list of resources on the Documents
later.

This fixes image loading in slintpad again.
This commit is contained in:
Tobias Hunger 2024-10-16 18:08:04 +02:00 committed by Tobias Hunger
parent 30ef606d04
commit 7f8da7bf28
4 changed files with 13 additions and 3 deletions

View file

@ -2971,6 +2971,9 @@ fn generate_resources(doc: &Document) -> Vec<TokenStream> {
.map(|(path, er)| {
let symbol = format_ident!("SLINT_EMBEDDED_RESOURCE_{}", er.id);
match &er.kind {
&crate::embedded_resources::EmbeddedResourcesKind::ListOnly => {
quote!()
},
crate::embedded_resources::EmbeddedResourcesKind::RawData => {
let data = embedded_file_tokens(path);
quote!(static #symbol: &'static [u8] = #data;)