From 1911b482d2fc6c695d892b2c016387ab36533dca Mon Sep 17 00:00:00 2001 From: Trinity Pointard Date: Wed, 4 Sep 2019 13:56:43 +0200 Subject: [PATCH] remove usage of drop_bomb --- Cargo.toml | 2 -- src/directory/managed_directory.rs | 5 +---- 2 files changed, 1 insertion(+), 6 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 4739b837b0..2fcb7055f7 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -55,8 +55,6 @@ murmurhash32 = "0.2" chrono = "0.4" smallvec = "0.6" -drop_bomb = "0.1.4" - [target.'cfg(windows)'.dependencies] winapi = "0.3" diff --git a/src/directory/managed_directory.rs b/src/directory/managed_directory.rs index a64965b66d..77da3a060c 100644 --- a/src/directory/managed_directory.rs +++ b/src/directory/managed_directory.rs @@ -343,7 +343,6 @@ struct FooterProxy { hasher: Option, /// always Some except after terminate call writer: Option, - bomb: drop_bomb::DropBomb, } impl FooterProxy { @@ -351,7 +350,6 @@ impl FooterProxy { FooterProxy { hasher: Some(Hasher::new()), writer: Some(writer), - bomb: drop_bomb::DropBomb::new("This must be terminated before dropping"), } } } @@ -370,9 +368,8 @@ impl Write for FooterProxy { impl TerminatingWrite for FooterProxy { fn terminate_ref(&mut self, _: AntiCallToken) -> io::Result<()> { - self.bomb.defuse(); let crc = self.hasher.take().unwrap().finalize(); - let footer = V0::from_crc(crc).to_bytes(); + let footer = Footer::V0(V0::from_crc(crc)).to_bytes(); let mut writer = self.writer.take().unwrap(); writer.write_all(&footer)?; writer.flush()?;//should we assume calling terminate on inner already flush?