From ff4c2d796e4771822095257ff5fe2d6d90528182 Mon Sep 17 00:00:00 2001 From: Tangent 128 Date: Mon, 7 Aug 2017 00:55:57 -0400 Subject: [PATCH] Remove IoResult return, value not needed and confuses ? operator --- src/ebml.rs | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/ebml.rs b/src/ebml.rs index e29e5ec..25c6705 100644 --- a/src/ebml.rs +++ b/src/ebml.rs @@ -192,17 +192,17 @@ pub fn encode_element IoResult, X>(tag: u64 Ok(()) } -pub fn encode_tag_header(tag: u64, size: Varint, output: &mut T) -> IoResult { - let id_size = encode_varint(Varint::Value(tag), output)?; - let size_size = encode_varint(size, output)?; - Ok(id_size + size_size) +pub fn encode_tag_header(tag: u64, size: Varint, output: &mut T) -> IoResult<()> { + encode_varint(Varint::Value(tag), output)?; + encode_varint(size, output)?; + Ok(()) } /// Tries to write a simple EBML tag with a string value -pub fn encode_string(tag: u64, string: &str, output: &mut T) -> IoResult { - let tag_size = encode_tag_header(tag, Varint::Value(string.len() as u64), output)?; - let string_size = output.write_all(string.as_ref()).map(|()| string.len())?; - Ok(tag_size + string_size) +pub fn encode_string(tag: u64, string: &str, output: &mut T) -> IoResult<()> { + encode_tag_header(tag, Varint::Value(string.len() as u64), output)?; + output.write_all(string.as_ref()).map(|()| string.len())?; + Ok(()) } #[derive(Debug, PartialEq)]