From 21697ac99e68c81d32ac6f3c17d50c085959b895 Mon Sep 17 00:00:00 2001 From: mrxiaozhuox Date: Sun, 20 Mar 2022 19:32:22 +0800 Subject: [PATCH] feat: add `custom html` support --- src/builder.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/builder.rs b/src/builder.rs index 60ce8a40d..a2006d63d 100644 --- a/src/builder.rs +++ b/src/builder.rs @@ -277,14 +277,14 @@ pub fn gen_page(config: &DioxusConfig, serve: bool) -> String { let custom_html_file = crate_root.join("index.html"); let mut html = if custom_html_file.is_file() { let mut buf = String::new(); - let file = File::open(custom_html_file).unwrap(); - if let Ok(v) = file.read_to_string(&mut buf) { + let mut file = File::open(custom_html_file).unwrap(); + if file.read_to_string(&mut buf).is_ok() { buf } else { String::from(include_str!("./assets/index.html")) } } else { - String::from(include_str!("./assets/index.html")); + String::from(include_str!("./assets/index.html")) }; let resouces = config.web.resource.clone();