diff --git a/Cargo.toml b/Cargo.toml index 9b1df0d..9665238 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -12,14 +12,17 @@ categories = ["hardware-support", "os::macos-apis"] edition = "2021" [dependencies] -core-foundation = "^0.9.1" -core-foundation-sys = "^0.8.1" -core-graphics = "^0.22.1" -ddc = "^0.2.0" -io-kit-sys = "0.1.0" -mach = "^0.3.2" -thiserror = "^1" -edid = "0.3.0" +core-foundation = "0.9" +core-foundation-sys = "0.8" +core-graphics = "0.23" +ddc = "0.2" +io-kit-sys = "0.3" +mach = "0.3" +thiserror = "1" + +[dev-dependencies] +edid-rs = "0.1" +nom = "*" [badges] maintenance = { status = "actively-developed" } diff --git a/examples/list.rs b/examples/list.rs index 93c9fff..1741728 100644 --- a/examples/list.rs +++ b/examples/list.rs @@ -24,20 +24,14 @@ fn main() { println!("\tCurrent input: {:04x}", input.value()); } - /* - match edid::parse(data: &[u8]) { - nom::IResult::Done(remaining, parsed) => { - assert_eq!(remaining.len(), 0); - assert_eq!(&parsed, expected); - }, - nom::IResult::Error(err) => { - panic!(format!("{}", err)); - }, - nom::IResult::Incomplete(_) => { - panic!("Incomplete"); - }, + if let Some(data) = monitor.edid() { + let mut cursor = std::io::Cursor::new(&data); + let mut reader = edid_rs::Reader::new(&mut cursor); + match edid_rs::EDID::parse(&mut reader) { + Ok(edid) => println!("\tEDID Info: {:?}", edid), + _ => println!("\tCould not parse provided EDID information"), + } } - */ } } } \ No newline at end of file