From e31aa5decb3db18fb31e0998525b8e4d06df7e90 Mon Sep 17 00:00:00 2001 From: Robert Garrett Date: Sun, 12 Oct 2025 21:18:32 -0500 Subject: [PATCH] Move `main.rs` to a test, drop dep on png crate The codec library doesn't use any external dependencies. The PNG crate is only to load some source material for testing the codec. Turning the test driver into a real test lets me turn the PNG dependency into a dev-dependency. --- Cargo.toml | 2 +- src/main.rs => tests/codec.rs | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) rename src/main.rs => tests/codec.rs (99%) diff --git a/Cargo.toml b/Cargo.toml index 3adc72d..e4678a7 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -5,5 +5,5 @@ edition = "2021" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html -[dependencies] +[dev-dependencies] png = "0.17.14" diff --git a/src/main.rs b/tests/codec.rs similarity index 99% rename from src/main.rs rename to tests/codec.rs index 82bda6c..0713741 100644 --- a/src/main.rs +++ b/tests/codec.rs @@ -7,6 +7,7 @@ use std::io::BufWriter; use std::path::Path; use std::{fs::File, io::Read}; +#[test] fn main() -> Result<(), DecodeError> { let file = File::open("qoi_test_images/dice.qoi").unwrap(); let mut bytes = file.bytes()