Ver código fonte

Fix a few warnings.

whitequark 7 anos atrás
pai
commit
64d306340b
2 arquivos alterados com 2 adições e 2 exclusões
  1. 1 1
      src/socket/tcp.rs
  2. 1 1
      src/storage/assembler.rs

+ 1 - 1
src/socket/tcp.rs

@@ -1375,7 +1375,7 @@ impl<'a> TcpSocket<'a> {
                     (Some(remote_last_ts), Some(timeout))
                             if !self.tx_buffer.is_empty() =>
                         Some(remote_last_ts + timeout),
-                    (None, Some(timeout)) =>
+                    (None, Some(_timeout)) =>
                         Some(0),
                     (_, _) =>
                         None

+ 1 - 1
src/storage/assembler.rs

@@ -152,7 +152,7 @@ impl Assembler {
         while index != self.contigs.len() && size != 0 {
             let contig = self.contigs[index];
 
-            if let Some(new_offset) = offset.checked_sub(contig.total_size()) {
+            if offset >= contig.total_size() {
                 // The range being added does not cover this contig, skip it.
                 index += 1;
             } else if offset == 0 && size >= contig.hole_size && index > 0 {