From 94ea72434453d596c0288658a75f93213e177d59 Mon Sep 17 00:00:00 2001 From: Bill Thiede Date: Sun, 18 Jul 2021 11:14:44 -0700 Subject: [PATCH] lights & world: derive Clone for PointLight and World. --- rtchallenge/src/lights.rs | 2 +- rtchallenge/src/world.rs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/rtchallenge/src/lights.rs b/rtchallenge/src/lights.rs index 3a1d942..fe02f0a 100644 --- a/rtchallenge/src/lights.rs +++ b/rtchallenge/src/lights.rs @@ -1,6 +1,6 @@ use crate::tuples::{Color, Tuple}; -#[derive(Debug, PartialEq)] +#[derive(Clone, Debug, PartialEq)] pub struct PointLight { pub position: Tuple, pub intensity: Color, diff --git a/rtchallenge/src/world.rs b/rtchallenge/src/world.rs index 83bc3e5..13a875e 100644 --- a/rtchallenge/src/world.rs +++ b/rtchallenge/src/world.rs @@ -20,7 +20,7 @@ use crate::{ /// assert_eq!(w.light, None); /// ``` -#[derive(Debug, Default)] +#[derive(Clone, Debug, Default)] pub struct World { // TODO(wathiede): make this a list of abstract Light traits. pub light: Option,