mirror of
https://github.com/Start9Labs/start-os.git
synced 2026-03-30 12:11:56 +00:00
miscellaneous fixes
This commit is contained in:
committed by
Aiden McClelland
parent
1eeffc0bf8
commit
e3d8861199
@@ -686,6 +686,12 @@ impl<H: Digest, W: std::io::Write> HashWriter<H, W> {
|
||||
pub fn finish(self) -> (H, W) {
|
||||
(self.hasher, self.writer)
|
||||
}
|
||||
pub fn inner(&self) -> &W {
|
||||
&self.writer
|
||||
}
|
||||
pub fn inner_mut(&mut self) -> &mut W {
|
||||
&mut self.writer
|
||||
}
|
||||
}
|
||||
impl<H: Digest, W: std::io::Write> std::io::Write for HashWriter<H, W> {
|
||||
fn write(&mut self, buf: &[u8]) -> std::io::Result<usize> {
|
||||
@@ -697,17 +703,6 @@ impl<H: Digest, W: std::io::Write> std::io::Write for HashWriter<H, W> {
|
||||
self.writer.flush()
|
||||
}
|
||||
}
|
||||
impl<H: Digest, W: std::io::Write> std::ops::Deref for HashWriter<H, W> {
|
||||
type Target = W;
|
||||
fn deref(&self) -> &Self::Target {
|
||||
&self.writer
|
||||
}
|
||||
}
|
||||
impl<H: Digest, W: std::io::Write> std::ops::DerefMut for HashWriter<H, W> {
|
||||
fn deref_mut(&mut self) -> &mut Self::Target {
|
||||
&mut self.writer
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)]
|
||||
pub struct Port(pub u16);
|
||||
|
||||
Reference in New Issue
Block a user