Adopt newer version of png lib
authorunC0Rr
Tue, 21 Jan 2025 22:14:28 +0100
changeset 16089 3f73daa3f212
parent 16088 2acea266d297
child 16090 a73830f5c5cc
Adopt newer version of png lib
rust/mapgen/Cargo.toml
rust/mapgen/src/theme.rs
--- a/rust/mapgen/Cargo.toml	Tue Jan 21 22:10:55 2025 +0100
+++ b/rust/mapgen/Cargo.toml	Tue Jan 21 22:14:28 2025 +0100
@@ -15,4 +15,4 @@
 serde = "1.0"
 serde_yaml = "0.9"
 serde_derive = "1.0"
-png = "0.13"
+png = "0.17"
--- a/rust/mapgen/src/theme.rs	Tue Jan 21 22:10:55 2025 +0100
+++ b/rust/mapgen/src/theme.rs	Tue Jan 21 22:14:28 2025 +0100
@@ -228,9 +228,10 @@
 
 fn load_sprite(path: &Path) -> Result<ThemeSprite, ThemeLoadError> {
     let decoder = Decoder::new(BufReader::new(File::open(path)?));
-    let (info, mut reader) = decoder.read_info()?;
+    let mut reader = decoder.read_info()?;
+    let info = reader.info();
 
-    if info.color_type != ColorType::RGBA {
+    if info.color_type != ColorType::Rgba {
         return Err(ThemeLoadError::Format(format!(
             "Unexpected format: {:?}",
             info.color_type