diff options
Diffstat (limited to 'dichroism/src/models/photo_set.rs')
-rw-r--r-- | dichroism/src/models/photo_set.rs | 25 |
1 files changed, 9 insertions, 16 deletions
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<Self> { 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(); - } -} |