Skip to content

Commit

Permalink
update README.md to reflect recent changes
Browse files Browse the repository at this point in the history
  • Loading branch information
IronBatman2715 authored and soerenmeier committed Sep 14, 2024
1 parent 39f57e5 commit ee9fbe7
Showing 1 changed file with 5 additions and 8 deletions.
13 changes: 5 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
@@ -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.
Expand All @@ -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.
Expand All @@ -23,15 +21,14 @@ fn main() {
}
}

fn run() -> io::Result<()> {
fn run() -> Result<(), Box<dyn Error>> {
// 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());
Expand Down

0 comments on commit ee9fbe7

Please sign in to comment.