File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -113,7 +113,6 @@ restriction = { level = "warn", priority = -2 }
113113
114114# lints to decide on
115115
116- arithmetic_side_effects = " allow" # TODO: consider
117116as_conversions = " allow" # TODO: tricky
118117cast_possible_truncation = " allow" # TODO: consider
119118cast_precision_loss = " allow" # TODO: consider
Original file line number Diff line number Diff line change @@ -300,7 +300,13 @@ impl<'data> ReadBuf<'data> {
300300 }
301301
302302 #[ inline]
303+ #[ allow( clippy:: arithmetic_side_effects) ]
303304 fn remaining ( & self ) -> usize {
305+ debug_assert ! (
306+ self . capacity( ) >= self . filled,
307+ "filled must fit in capacity()"
308+ ) ;
309+ // Cannot overflow, asserted above
304310 self . capacity ( ) - self . filled
305311 }
306312
@@ -359,6 +365,7 @@ impl ReadBufCursor<'_> {
359365 ///
360366 /// `self` must have enough remaining capacity to contain all of `src`.
361367 #[ inline]
368+ #[ allow( clippy:: arithmetic_side_effects) ]
362369 pub fn put_slice ( & mut self , src : & [ u8 ] ) {
363370 assert ! (
364371 self . buf. remaining( ) >= src. len( ) ,
You can’t perform that action at this time.
0 commit comments