Implement instance tree visualization

This commit is contained in:
Lucien Greathouse
2019-09-24 16:46:19 -07:00
parent e8a5e44319
commit 7a1eda98ca
3 changed files with 130 additions and 14 deletions

View File

@@ -1,5 +1,3 @@
use std::{fs, path::Path};
static LOGO: &[u8] = include_bytes!("../../assets/logo-512.png");
static ICON: &[u8] = include_bytes!("../../assets/icon-32.png");
static HOME_CSS: &str = include_str!("../../assets/index.css");
@@ -8,12 +6,14 @@ macro_rules! declare_asset {
($name: ident, $path: expr) => {
pub fn $name() -> &'static str {
if cfg!(feature = "dev-live-assets") {
use std::{fs::read_to_string, path::Path};
let file_path = Path::new(file!());
let asset_path = file_path.parent().unwrap().join($path);
println!("Reloading {}", asset_path.display());
let content = fs::read_to_string(asset_path)
let content = read_to_string(asset_path)
.expect("Couldn't read dev live asset")
.into_boxed_str();