perf(h1): assert less around date formatter
This commit is contained in:
		| @@ -37,8 +37,8 @@ impl CachedDate { | ||||
|  | ||||
|     fn update(&mut self, now: time::Timespec) { | ||||
|         self.pos = 0; | ||||
|         write!(self, "{}", time::at_utc(now).rfc822()).unwrap(); | ||||
|         assert!(self.pos == DATE_VALUE_LENGTH); | ||||
|         let _ = write!(self, "{}", time::at_utc(now).rfc822()); | ||||
|         debug_assert!(self.pos == DATE_VALUE_LENGTH); | ||||
|         self.next_update = now + Duration::seconds(1); | ||||
|         self.next_update.nsec = 0; | ||||
|     } | ||||
| @@ -56,4 +56,4 @@ impl fmt::Write for CachedDate { | ||||
| #[test] | ||||
| fn test_date_len() { | ||||
|     assert_eq!(DATE_VALUE_LENGTH, "Sun, 06 Nov 1994 08:49:37 GMT".len()); | ||||
| } | ||||
| } | ||||
|   | ||||
| @@ -1002,7 +1002,7 @@ mod tests { | ||||
|         b.iter(|| { | ||||
|             let mut vec = Vec::new(); | ||||
|             Server::encode(head.clone(), Some(BodyLength::Known(10)), &mut None, false, &mut vec).unwrap(); | ||||
|             //assert_eq!(vec.len(), len); | ||||
|             assert_eq!(vec.len(), len); | ||||
|             ::test::black_box(vec); | ||||
|         }) | ||||
|     } | ||||
|   | ||||
		Reference in New Issue
	
	Block a user