summaryrefslogtreecommitdiff
path: root/src/env.rs
diff options
context:
space:
mode:
authorLaurenz <laurmaedje@gmail.com>2021-02-11 17:33:13 +0100
committerLaurenz <laurmaedje@gmail.com>2021-02-11 17:33:13 +0100
commit1711b67877ce5c290e049775c340c9324f15341e (patch)
tree92d6ff7285cdc2d694ccfdf733ce8757866636ec /src/env.rs
parentf9197dcfef11c4c054a460c80ff6023dae6f1f2a (diff)
Move all pretty printing into one module and pretty print values 🦋
Diffstat (limited to 'src/env.rs')
-rw-r--r--src/env.rs11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/env.rs b/src/env.rs
index aaa04aa2..66cc5e19 100644
--- a/src/env.rs
+++ b/src/env.rs
@@ -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>,