From 2060048c796e689614b696a8c1537951f37f48c9 Mon Sep 17 00:00:00 2001 From: kevgeniy Date: Sun, 16 Oct 2016 17:13:02 +0200 Subject: [PATCH] Fixed and made the comments clearer --- src/cat/cat.rs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/cat/cat.rs b/src/cat/cat.rs index c1a81bf05..90db91ee8 100644 --- a/src/cat/cat.rs +++ b/src/cat/cat.rs @@ -320,6 +320,9 @@ impl<'a, W: Write> UnsafeWriter<'a, W> { } } +// This method was used in Write::write only. It must not be called in the correct cat code +// and is placed in the bottleneck place, so it is not used anymore. +// Uncomment this and code in Write::write for more convenient testing of a new cat version. //#[inline(never)] //fn fail() -> ! { // panic!("assertion failed"); @@ -329,8 +332,8 @@ impl<'a, W: Write> Write for UnsafeWriter<'a, W> { fn write(&mut self, buf: &[u8]) -> Result { //let dst = &mut self.buf[self.pos..]; let len = buf.len(); - // assertion is true for current code - // and it is a bottlneck place + // the condition is false for current code and every correct code + // see fail method comment for more information // if len > dst.len() { // fail(); // }