summaryrefslogtreecommitdiff
path: root/src/lossless/lsb.rs
diff options
context:
space:
mode:
authorLibravatar Silas Bartha <silas@exvacuum.dev>2024-06-13 20:37:10 -0400
committerLibravatar Silas Bartha <silas@exvacuum.dev>2024-06-13 20:37:10 -0400
commit5b5f1bed5e8da9d799e5910793477ba0360d5135 (patch)
treeab7f7677593cae40dd3f21ba4246d016dc23b2de /src/lossless/lsb.rs
parent2a50eb9b405efb2a1935ebea229791d61272fe8c (diff)
Removed unnecessary into calls in LSB codecv0.2.1
Diffstat (limited to 'src/lossless/lsb.rs')
-rw-r--r--src/lossless/lsb.rs10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/lossless/lsb.rs b/src/lossless/lsb.rs
index f8f1113..2ce1456 100644
--- a/src/lossless/lsb.rs
+++ b/src/lossless/lsb.rs
@@ -14,9 +14,9 @@ pub struct LsbCodec;
impl Codec for LsbCodec {
fn encode(&self, carrier: &[u8], payload: &[u8]) -> Result<Vec<u8>, CodecError>
{
- let image_format = image::guess_format(carrier.into()).unwrap();
- let mut image: DynamicImage = image::load_from_memory(carrier.into()).unwrap();
- let payload: &[u8] = payload.into();
+ let image_format = image::guess_format(carrier).unwrap();
+ let mut image: DynamicImage = image::load_from_memory(carrier).unwrap();
+ let payload: &[u8] = payload;
if image.pixels().count() < payload.len() {
return Err(CodecError::DataInvalid("Payload Too Big for Carrier".into()));
@@ -55,8 +55,8 @@ impl Codec for LsbCodec {
fn decode(&self, carrier: &[u8]) -> Result<(Vec<u8>, Vec<u8>), CodecError>
{
- let image_format = image::guess_format(carrier.into()).unwrap();
- let mut image: DynamicImage = image::load_from_memory(carrier.into()).unwrap();
+ let image_format = image::guess_format(carrier).unwrap();
+ let mut image: DynamicImage = image::load_from_memory(carrier).unwrap();
let mut payload: Vec<u8> = Vec::new();
match image {