Provide explicit type to Iterator::sum() calls to avoid ambiguity

This commit is contained in:
Sebastian Dröge 2022-11-17 10:15:46 +02:00
parent 6b11284e8a
commit 1981ffbea0
2 changed files with 2 additions and 2 deletions

View file

@ -202,7 +202,7 @@ impl<T: AsRef<[u8]>> LineReader<T> {
// Otherwise we have to copy everything that is remaining into our
// internal buffer and then return a slice from that
let len = self.queue.iter().map(|v| v.as_ref().len()).sum();
let len = self.queue.iter().map(|v| v.as_ref().len()).sum::<usize>();
if self.buf.capacity() < len {
self.buf.reserve(len - self.buf.capacity());
}

View file

@ -202,7 +202,7 @@ impl<T: AsRef<[u8]>> LineReader<T> {
// Otherwise we have to copy everything that is remaining into our
// internal buffer and then return a slice from that
let len = self.queue.iter().map(|v| v.as_ref().len()).sum();
let len = self.queue.iter().map(|v| v.as_ref().len()).sum::<usize>();
if self.buf.capacity() < len {
self.buf.reserve(len - self.buf.capacity());
}