camera: add default implementations.

This commit is contained in:
Bill Thiede 2021-07-22 20:44:49 -07:00
parent 9389fed84c
commit 166c87dfe5

View File

@ -28,6 +28,13 @@ pub enum RenderStrategy {
Rayon,
WorkerPool,
}
impl Default for RenderStrategy {
fn default() -> RenderStrategy {
RenderStrategy::Rayon
}
}
impl FromStr for RenderStrategy {
type Err = serde_json::error::Error;
fn from_str(s: &str) -> Result<RenderStrategy, serde_json::error::Error> {
@ -35,7 +42,7 @@ impl FromStr for RenderStrategy {
}
}
#[derive(Clone)]
#[derive(Clone, Default)]
pub struct Camera {
hsize: usize,
vsize: usize,