From 7556040da287ea0a50b2ea3a83e0e8f486d4c2b9 Mon Sep 17 00:00:00 2001 From: IronBatman2715 <72224765+IronBatman2715@users.noreply.github.com> Date: Fri, 13 Sep 2024 18:45:57 -0400 Subject: [PATCH] update `README.md` to reflect recent changes --- README.md | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index d6e6dbd..6607a65 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # gpt [![crates.io](https://img.shields.io/crates/v/gpt.svg)](https://crates.io/crates/gpt) -![minimum rust 1.63](https://img.shields.io/badge/rust-1.63%2B-orange.svg) +![minimum rust 1.65](https://img.shields.io/badge/rust-1.65%2B-orange.svg) [![Documentation](https://docs.rs/gpt/badge.svg)](https://docs.rs/gpt) A pure-Rust library to work with GPT partition tables. @@ -11,9 +11,7 @@ tables. It supports any that implements the `Read + Write + Seek + Debug` trait ## Example ```rust -use gpt; - -use std::io; +use std::error::Error; fn main() { // Inspect disk image, handling errors. @@ -23,15 +21,14 @@ fn main() { } } -fn run() -> io::Result<()> { +fn run() -> Result<(), Box> { // First parameter is target disk image (optional, default: fixtures sample) - let sample = "tests/fixtures/gpt-linux-disk-01.img".to_string(); + let sample = "tests/fixtures/gpt-disk.img".to_string(); let input = std::env::args().nth(1).unwrap_or(sample); // Open disk image. - let diskpath = std::path::Path::new(&input); let cfg = gpt::GptConfig::new().writable(false); - let disk = cfg.open(diskpath)?; + let disk = cfg.open(input)?; // Print GPT layout. println!("Disk (primary) header: {:#?}", disk.primary_header());