Actualiza actix-web a la versión 4
This commit is contained in:
parent
cafc4422fa
commit
82d23c2499
9 changed files with 20 additions and 21 deletions
|
|
@ -3,17 +3,18 @@ use static_files::resource_dir;
|
|||
use std::env;
|
||||
use std::path::Path;
|
||||
|
||||
fn main() {
|
||||
build_resource_dir("./static/theme", "theme.rs", "assets");
|
||||
build_resource_dir("./static/aliner", "aliner.rs", "assets");
|
||||
build_resource_dir("./static/bootsier", "bootsier.rs", "assets");
|
||||
fn main() -> std::io::Result<()> {
|
||||
build_resource_dir("./static/theme", "theme")?;
|
||||
build_resource_dir("./static/aliner", "aliner")?;
|
||||
build_resource_dir("./static/bootsier", "bootsier")?;
|
||||
build_resource_dir("./static/bulmix", "bulmix")
|
||||
}
|
||||
|
||||
fn build_resource_dir(dir: &str, with_filename: &str, with_fn: &str) {
|
||||
fn build_resource_dir(dir: &str, name: &str) -> std::io::Result<()> {
|
||||
let mut resource = resource_dir(dir);
|
||||
resource.with_generated_filename(
|
||||
Path::new(env::var("OUT_DIR").unwrap().as_str()).join(with_filename)
|
||||
Path::new(env::var("OUT_DIR").unwrap().as_str()).join(format!("{}.rs", name))
|
||||
);
|
||||
resource.with_generated_fn(with_fn);
|
||||
resource.build().unwrap();
|
||||
resource.with_module_name(format!("resources_{}", name));
|
||||
resource.build()
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue