From 2ece704c17b139b059a74dc0ddb53ef790937178 Mon Sep 17 00:00:00 2001 From: Tomas Kukosa Date: Wed, 11 Oct 2023 20:42:21 +0200 Subject: [PATCH 1/2] Update list of boards and dependencies --- .gitignore | 1 + Cargo.lock | 32 ++++++++++++++++---------------- Cargo.toml | 6 +++--- README.md | 4 ++-- src/main.rs | 6 +++--- 5 files changed, 25 insertions(+), 24 deletions(-) diff --git a/.gitignore b/.gitignore index e89d255..297ebeb 100644 --- a/.gitignore +++ b/.gitignore @@ -7,3 +7,4 @@ # IntelliJ IDEA module files *.iml +/.idea diff --git a/Cargo.lock b/Cargo.lock index f9df026..88b4713 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -15,9 +15,9 @@ dependencies = [ [[package]] name = "bytes" -version = "1.1.0" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c4872d67bab6358e59559027aa3b9157c53d9358c51423c17554809a8858e0f8" +checksum = "a2bd12c1caf447e69cd4528f47f94d203fd2582878ecb9e9465484c4148a8223" [[package]] name = "getopts" @@ -39,9 +39,9 @@ dependencies = [ [[package]] name = "hexplay" -version = "0.2.1" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0962bea6731e28b5a443ba4aa00fe3e4fe7555dadf12012435efb738eeac5898" +checksum = "2da1f4f846e8dcc1b5225caf702924816cabd855e4b46115c334ba09d5254a21" dependencies = [ "atty", "termcolor", @@ -61,7 +61,7 @@ checksum = "4d58d1b70b004888f764dfbf6a26a3b0342a1632d33968e4a179d8011c760614" [[package]] name = "oxi" -version = "0.2.1" +version = "0.2.2" dependencies = [ "bytes", "getopts", @@ -71,11 +71,11 @@ dependencies = [ [[package]] name = "termcolor" -version = "0.3.6" +version = "1.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "adc4587ead41bf016f11af03e55a624c06568b5a19db4e90fde573d805074f83" +checksum = "6093bad37da69aab9d123a8091e4be0aa4a03e4d601ec641c327398315f62b64" dependencies = [ - "wincolor", + "winapi-util", ] [[package]] @@ -101,16 +101,16 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" [[package]] -name = "winapi-x86_64-pc-windows-gnu" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" - -[[package]] -name = "wincolor" +name = "winapi-util" version = "0.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eeb06499a3a4d44302791052df005d5232b927ed1a9658146d842165c4de7767" +checksum = "f29e6f9198ba0d26b4c9f07dbe6f9ed633e1f3d5b8b414090084349e46a52596" dependencies = [ "winapi", ] + +[[package]] +name = "winapi-x86_64-pc-windows-gnu" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" diff --git a/Cargo.toml b/Cargo.toml index f095043..508aeba 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,11 +1,11 @@ [package] name = "oxi" -version = "0.2.1" +version = "0.2.2" authors = ["Tomas Kukosa "] edition = "2021" [dependencies] -bytes = "1.1.0" +bytes = "1.5.0" getopts = "0.2.21" -hexplay = "0.2.1" +hexplay = "0.3.0" lazy_static = "1.4.0" diff --git a/README.md b/README.md index 5e7af28..ce11bff 100644 --- a/README.md +++ b/README.md @@ -11,7 +11,7 @@ - [OLinuXino U-Boot boards.c file with list of boards][OLINUXINO-UBOOT-BOARDS] ##### Generate list of board IDs from OLinuXino U-Boot boards.c file -`wget -qO- https://raw.githubusercontent.com/OLIMEX/u-boot-olinuxino/release-20211130/board/olimex/common/boards.c | perl extract_board_ids.pl > boards.rs` +`wget -qO- https://raw.githubusercontent.com/OLIMEX/u-boot-olinuxino/release-20230515/board/olimex/common/boards.c | perl extract_board_ids.pl > boards.rs` ## License - MIT license ([LICENSE-MIT](LICENSE-MIT) or http://opensource.org/licenses/MIT) @@ -24,4 +24,4 @@ [license-link]: http://opensource.org/licenses/MIT [OLINUXINO]: https://github.com/OLIMEX/OLINUXINO [OLIMEX-A20-EEPROM]: https://github.com/OLIMEX/OLINUXINO/blob/master/SOFTWARE/A20/A20-eeprom-contents/Olimex-A20-EEPROM-October-2019.pdf -[OLINUXINO-UBOOT-BOARDS]: https://github.com/OLIMEX/u-boot-olinuxino/blob/release-20211130/board/olimex/common/boards.c +[OLINUXINO-UBOOT-BOARDS]: https://github.com/OLIMEX/u-boot-olinuxino/blob/release-20230515/board/olimex/common/boards.c diff --git a/src/main.rs b/src/main.rs index b4c884c..2f9208e 100644 --- a/src/main.rs +++ b/src/main.rs @@ -118,17 +118,17 @@ fn parse_buf(buf: &[u8]) { println!("MAC : {}", mac); } -fn main() -> Result<(), std::io::Error> { +fn main() -> Result<(), io::Error> { let args = env::args().skip(1).collect::>(); let mut opts = Options::new(); opts.optopt("i", "i2c", "Number of the I2C bus", "I2CBUS"); opts.optflag("x", "hex", "Hexadecimal dump"); opts.optflag("h", "help", "Help"); - let matches = match opts.parse(&args) { + let matches = match opts.parse(args) { Ok(m) => m, Err(f) => { - eprintln!("{}", f.to_string()); + eprintln!("{}", f); usage(&opts); std::process::exit(1); } From 6f512d2a71f193ec3cf637b912b41acd3fbea0d7 Mon Sep 17 00:00:00 2001 From: Tomas Kukosa Date: Wed, 11 Oct 2023 20:45:43 +0200 Subject: [PATCH 2/2] Fix clippy warning --- src/main.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main.rs b/src/main.rs index 2f9208e..fca48a7 100644 --- a/src/main.rs +++ b/src/main.rs @@ -148,7 +148,7 @@ fn main() -> Result<(), io::Error> { // find EEPROM let devs = find_i2c_devs(); let eeproms = find_eeproms(&devs); - if let Some(&i) = eeproms.get(0) { + if let Some(&i) = eeproms.first() { i } else { eprintln!("EEPROM not found");