mirror of
https://github.com/lifegpc/msg-tool.git
synced 2026-06-08 13:58:50 +08:00
Add support to dump name for panicon
This commit is contained in:
@@ -542,6 +542,15 @@ impl std::fmt::Debug for MemReader {
|
||||
}
|
||||
}
|
||||
|
||||
impl<'a> std::fmt::Debug for MemReaderRef<'a> {
|
||||
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
||||
f.debug_struct("MemReaderRef")
|
||||
.field("pos", &self.pos)
|
||||
.field("data_length", &self.data.len())
|
||||
.finish_non_exhaustive()
|
||||
}
|
||||
}
|
||||
|
||||
impl MemReader {
|
||||
pub fn new(data: Vec<u8>) -> Self {
|
||||
MemReader { data, pos: 0 }
|
||||
@@ -553,12 +562,20 @@ impl MemReader {
|
||||
pos: self.pos,
|
||||
}
|
||||
}
|
||||
|
||||
pub fn is_eof(&self) -> bool {
|
||||
self.pos >= self.data.len()
|
||||
}
|
||||
}
|
||||
|
||||
impl<'a> MemReaderRef<'a> {
|
||||
pub fn new(data: &'a [u8]) -> Self {
|
||||
MemReaderRef { data, pos: 0 }
|
||||
}
|
||||
|
||||
pub fn is_eof(&self) -> bool {
|
||||
self.pos >= self.data.len()
|
||||
}
|
||||
}
|
||||
|
||||
impl Read for MemReader {
|
||||
|
||||
Reference in New Issue
Block a user