Skip to content

Commit 012f12b

Browse files
committed
Implements Display on ItemReader
1 parent 1953715 commit 012f12b

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

obfw/src/reader.rs

+11
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
use crate::{DumpItem, MAGIC};
22
use core::error::Error;
3+
use core::fmt::{Display, Formatter};
34
use std::boxed::Box;
45
use std::io::{ErrorKind, Read};
56
use thiserror::Error;
@@ -58,6 +59,16 @@ pub enum ItemReader<'a, F> {
5859
Ps4Part(crate::ps4::PartReader<'a, F>),
5960
}
6061

62+
impl<'a, F> Display for ItemReader<'a, F> {
63+
fn fmt(&self, f: &mut Formatter<'_>) -> core::fmt::Result {
64+
let name = match self {
65+
Self::Ps4Part(_) => "PlayStation 4 partition",
66+
};
67+
68+
f.write_str(name)
69+
}
70+
}
71+
6172
/// Represents an error when [`DumpReader`] fails to read the dump.
6273
#[derive(Debug, Error)]
6374
pub enum ReaderError {

0 commit comments

Comments
 (0)