diff --git a/src/main.rs b/src/main.rs index c781d13..a3c24f9 100644 --- a/src/main.rs +++ b/src/main.rs @@ -18,14 +18,14 @@ struct FloatingImage { } impl FloatingImage { - fn new(width: u32, height: u32, name: String) -> Self { + fn new(width: u32, height: u32, name: &String) -> Self { let buffer_capacity = 3_655_744; let buffer: Vec = Vec::with_capacity(buffer_capacity); FloatingImage { width, height, data: buffer, - name, + name: name.to_string(), } } @@ -49,7 +49,7 @@ fn main() -> Result<(), ImageDataErrors> { println!("{}", &blurhash); let pixels = decode(&blurhash, 50, 50, 1.0).unwrap(); - let mut output = FloatingImage::new(50, 50, "image.png".to_string()); + let mut output = FloatingImage::new(50, 50, &args[2]); output.set_data(pixels)?; image::save_buffer_with_format( output.name,