Browse Source

add Debug impl for vfs::Arc

master
Alison Watson 1 month ago
parent
commit
52189645f6
2 changed files with 12 additions and 1 deletions
  1. +11
    -0
      source/framework/data/vfs.rs
  2. +1
    -1
      source/main_test/entry.rs

+ 11
- 0
source/framework/data/vfs.rs View File

@@ -2,6 +2,7 @@ use crate::{data::read, defl};
use smol_str::SmolStr;
use std::{
collections::HashMap,
fmt,
fs,
hash::Hasher,
io::{self, Read},
@@ -80,6 +81,16 @@ fn file_ref(
Ok(hash)
}

impl fmt::Debug for Arc {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
f.write_str("Arc { ")?;
for (name, _file) in self.files.iter() {
write!(f, "{:#?}, ", name)?;
}
f.write_str(" }")
}
}

impl File {
pub fn text(&self) -> Result<&str, Utf8Error> {
std::str::from_utf8(self.data())


+ 1
- 1
source/main_test/entry.rs View File

@@ -371,7 +371,7 @@ pub fn run(
let concur_frames = conf.render.concurrent_frames.into();

let hal = hal::ctx::Context::new()?;
let window = hal::win::Window::new(&hal, meta::ffi::name(), 640, 480)?;
let window = hal::win::Window::new(&hal, meta::ffi::NAME, 640, 480)?;

let entry = ash::Entry::new()?;
let instance = Instance::create(&conf.render, entry, &window)?;


Loading…
Cancel
Save