Skip to content

Commit

Permalink
GNUmakefile -> Makefile
Browse files Browse the repository at this point in the history
Also fix some clippy warnings.
  • Loading branch information
sevagh committed Nov 21, 2019
1 parent 19e9118 commit 3a4ec11
Show file tree
Hide file tree
Showing 5 changed files with 30 additions and 14 deletions.
File renamed without changes.
36 changes: 26 additions & 10 deletions erased-serde-json/src/ser.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,29 @@ use serde_json::ser::CharEscape;

pub trait Formatter {
fn erased_write_null(&mut self, writer: &mut dyn io::Write) -> Result<(), io::Error>;
fn erased_write_bool(&mut self, writer: &mut dyn io::Write, value: bool) -> Result<(), io::Error>;
fn erased_write_bool(
&mut self,
writer: &mut dyn io::Write,
value: bool,
) -> Result<(), io::Error>;
fn erased_write_i8(&mut self, writer: &mut dyn io::Write, value: i8) -> Result<(), io::Error>;
fn erased_write_i16(&mut self, writer: &mut dyn io::Write, value: i16) -> Result<(), io::Error>;
fn erased_write_i32(&mut self, writer: &mut dyn io::Write, value: i32) -> Result<(), io::Error>;
fn erased_write_i64(&mut self, writer: &mut dyn io::Write, value: i64) -> Result<(), io::Error>;
fn erased_write_i16(&mut self, writer: &mut dyn io::Write, value: i16)
-> Result<(), io::Error>;
fn erased_write_i32(&mut self, writer: &mut dyn io::Write, value: i32)
-> Result<(), io::Error>;
fn erased_write_i64(&mut self, writer: &mut dyn io::Write, value: i64)
-> Result<(), io::Error>;
fn erased_write_u8(&mut self, writer: &mut dyn io::Write, value: u8) -> Result<(), io::Error>;
fn erased_write_u16(&mut self, writer: &mut dyn io::Write, value: u16) -> Result<(), io::Error>;
fn erased_write_u32(&mut self, writer: &mut dyn io::Write, value: u32) -> Result<(), io::Error>;
fn erased_write_u64(&mut self, writer: &mut dyn io::Write, value: u64) -> Result<(), io::Error>;
fn erased_write_f32(&mut self, writer: &mut dyn io::Write, value: f32) -> Result<(), io::Error>;
fn erased_write_f64(&mut self, writer: &mut dyn io::Write, value: f64) -> Result<(), io::Error>;
fn erased_write_u16(&mut self, writer: &mut dyn io::Write, value: u16)
-> Result<(), io::Error>;
fn erased_write_u32(&mut self, writer: &mut dyn io::Write, value: u32)
-> Result<(), io::Error>;
fn erased_write_u64(&mut self, writer: &mut dyn io::Write, value: u64)
-> Result<(), io::Error>;
fn erased_write_f32(&mut self, writer: &mut dyn io::Write, value: f32)
-> Result<(), io::Error>;
fn erased_write_f64(&mut self, writer: &mut dyn io::Write, value: f64)
-> Result<(), io::Error>;
fn erased_begin_string(&mut self, writer: &mut dyn io::Write) -> Result<(), io::Error>;
fn erased_end_string(&mut self, writer: &mut dyn io::Write) -> Result<(), io::Error>;
fn erased_write_string_fragment(
Expand Down Expand Up @@ -130,7 +142,11 @@ where
fn erased_end_object(&mut self, w: &mut dyn io::Write) -> Result<(), io::Error> {
self.end_object(w)
}
fn erased_begin_object_key(&mut self, w: &mut dyn io::Write, first: bool) -> Result<(), io::Error> {
fn erased_begin_object_key(
&mut self,
w: &mut dyn io::Write,
first: bool,
) -> Result<(), io::Error> {
self.begin_object_key(w, first)
}
fn erased_end_object_key(&mut self, w: &mut dyn io::Write) -> Result<(), io::Error> {
Expand Down
2 changes: 1 addition & 1 deletion stream-delimit/src/kafka_consumer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ impl KafkaConsumer {
consumer,
messages: VecDeque::new(),
}),
Err(e) => Err(StreamDelimitError::KafkaInitializeError(e))?,
Err(e) => Err(StreamDelimitError::KafkaInitializeError(e)),
}
}
}
2 changes: 1 addition & 1 deletion stream-delimit/src/stream.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,6 @@ pub fn str_to_streamtype(input: &str) -> Result<StreamType> {
"i32be" => Ok(StreamType::I32BE),
_ => Err(StreamDelimitError::InvalidStreamTypeError(
input.to_string(),
))?,
)),
}
}
4 changes: 2 additions & 2 deletions stream-delimit/src/varint.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ pub fn decode_varint(read: &mut dyn Read) -> Result<u64> {
varint_buf.push(0u8);
match read.read_exact(&mut varint_buf[i..]) {
Ok(_) => (),
Err(e) => return Err(StreamDelimitError::VarintDecodeError(e))?,
Err(e) => return Err(StreamDelimitError::VarintDecodeError(e)),
}
if (varint_buf[i] & 0x80) >> 7 != 0x1 {
let mut concat: u64 = 0;
Expand All @@ -38,7 +38,7 @@ pub fn decode_varint(read: &mut dyn Read) -> Result<u64> {
return Ok(concat);
}
}
Err(StreamDelimitError::VarintDecodeMaxBytesError)?
Err(StreamDelimitError::VarintDecodeMaxBytesError)
}

pub fn encode_varint(mut value: u64) -> Vec<u8> {
Expand Down

0 comments on commit 3a4ec11

Please sign in to comment.