From 5cb0869b94fc8b9aff564055af9a60046de7b028 Mon Sep 17 00:00:00 2001 From: "Adam T. Carpenter" Date: Thu, 22 Oct 2020 22:09:46 -0400 Subject: Skipped separate photo table; working handler for get all products (lacking cats) --- dichroism/src/models/photo_set.rs | 25 +++++++++---------------- 1 file changed, 9 insertions(+), 16 deletions(-) (limited to 'dichroism/src/models/photo_set.rs') diff --git a/dichroism/src/models/photo_set.rs b/dichroism/src/models/photo_set.rs index 84fe0e1..7187c65 100644 --- a/dichroism/src/models/photo_set.rs +++ b/dichroism/src/models/photo_set.rs @@ -21,6 +21,15 @@ pub struct PhotoSet { } impl PhotoSet { + pub fn from_photos(original: Photo, fullsize: Photo, base: Photo, thumbnail: Photo) -> Self { + Self { + original, + fullsize, + base, + thumbnail, + } + } + pub fn from_data_uri(uri: &str) -> Result { let data = DATA_URI_RE .captures(uri) @@ -50,19 +59,3 @@ impl PhotoSet { }) } } - -#[cfg(test)] -mod tests { - //use super::*; - - const TEST_DATA_URI: &str = include_str!("../unit_test_data/img_data_uri.txt"); - const TEST_DATA_BASE64: &str = include_str!("../unit_test_data/test_data_base64.txt"); - - #[test] - fn test_gen_product_images() { - // PhotoSet::from_data_uri(TEST_DATA_URI.trim()) - // .unwrap() - // .commit(".") - // .unwrap(); - } -} -- cgit v1.2.3