kilork / actix-web-static-files

actix-web static files as resources support
The Unlicense
75 stars 18 forks source link

Add possibility to generate resource map without function wrapper #31

Closed kilork closed 3 years ago

kilork commented 3 years ago

rust-analyser fails to resolve functions from included generated files, which shows in the editor errors.

This is not nice for user experience. We would add new functions to generate only hash map.

Then usage is would be like:

fn generate() -> ::std::collections::HashMap<&'static str, actix_web_static_files::Resource> {
  include!(concat!(env!("OUT_DIR"), "/generated.rs"));
}

Looks like it would be more meaningful not only in this case.