changeset 36:e80e00619c81

Remove unnecessary Sized constraint from some types
author Lewin Bormann <lbo@spheniscida.de>
date Sun, 31 Jan 2016 19:57:17 +0000
parents fcb3ee662ee7
children bda56504a12c
files src/formats/util.rs src/formats/writelog.rs
diffstat 2 files changed, 4 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/src/formats/util.rs	Sun Jan 31 19:43:53 2016 +0000
+++ b/src/formats/util.rs	Sun Jan 31 19:57:17 2016 +0000
@@ -74,7 +74,7 @@
 /// that can be used to write the output of a reduce partition.
 /// Values are always written as a whole to the writer.
 pub trait MRSinkGenerator {
-    type Sink: io::Write + Sized;
+    type Sink: io::Write;
     /// Return a new output.
     fn new_output(&mut self, name: &String) -> Self::Sink;
 }
--- a/src/formats/writelog.rs	Sun Jan 31 19:43:53 2016 +0000
+++ b/src/formats/writelog.rs	Sun Jan 31 19:57:17 2016 +0000
@@ -30,7 +30,7 @@
 /// files are indexed by IDX files describing offset and length of single entries,
 /// which is why we don't need length prefixes here.
 ///
-pub struct WriteLogWriter<Sink: Write + Sized> {
+pub struct WriteLogWriter<Sink: Write> {
     dest: Sink,
 
     current_length: u64,
@@ -57,7 +57,7 @@
     val
 }
 
-impl<Sink: Write + Sized> WriteLogWriter<Sink> {
+impl<Sink: Write> WriteLogWriter<Sink> {
     /// Return a new WriteLog that writes to dest
     pub fn new(dest: Sink) -> WriteLogWriter<Sink> {
         WriteLogWriter {
@@ -83,7 +83,7 @@
         (self.current_length, self.records_written)
     }
 }
-impl<Sink: Write + Sized> Write for WriteLogWriter<Sink> {
+impl<Sink: Write> Write for WriteLogWriter<Sink> {
     fn write(&mut self, buf: &[u8]) -> Result<usize> {
         // BUG: May not account the length in a correct way if the length prefix
         // is written, but not the record.