sg-sprite 0.3.2

Application for restoring Mages engine sprites (Steins;Gate, Steins;Gate 0, Chaos;Child)
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
use std::fmt::{self, Write, LowerHex, UpperHex, Formatter};

pub struct Hex<'a>(pub &'a [u8]);

macro_rules! fmt_impl { ($trait:ident, $fmt:expr) => {
    impl $trait for Hex<'_> {
        fn fmt(&self, f: &mut Formatter<'_>) -> fmt::Result {
            for b in self.0 { write!(f, $fmt, b)?; }
            Ok(())
        }
    }
}}

fmt_impl!(LowerHex, "{:02x}");
fmt_impl!(UpperHex, "{:02X}");