diff options
| author | Laurenz <laurmaedje@gmail.com> | 2021-02-11 17:33:13 +0100 |
|---|---|---|
| committer | Laurenz <laurmaedje@gmail.com> | 2021-02-11 17:33:13 +0100 |
| commit | 1711b67877ce5c290e049775c340c9324f15341e (patch) | |
| tree | 92d6ff7285cdc2d694ccfdf733ce8757866636ec /src/env.rs | |
| parent | f9197dcfef11c4c054a460c80ff6023dae6f1f2a (diff) | |
Move all pretty printing into one module and pretty print values 🦋
Diffstat (limited to 'src/env.rs')
| -rw-r--r-- | src/env.rs | 11 |
1 files changed, 11 insertions, 0 deletions
@@ -7,6 +7,7 @@ use std::fs; use std::io::Cursor; use std::path::{Path, PathBuf}; +use fontdock::fs::FsSource; use image::io::Reader as ImageReader; use image::{DynamicImage, GenericImageView, ImageFormat}; @@ -21,6 +22,16 @@ pub struct Env { pub resources: ResourceLoader, } +impl Env { + /// Create an empty environment for testing purposes. + pub fn blank() -> Self { + Self { + fonts: FontLoader::new(Box::new(FsSource::new(vec![])), vec![]), + resources: ResourceLoader::new(), + } + } +} + /// Loads resource from the file system. pub struct ResourceLoader { paths: HashMap<PathBuf, ResourceId>, |
