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

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/986>
This commit is contained in:
Sebastian Dröge 2022-11-17 10:15:46 +02:00
parent 8bd9de8d48
commit 582cc34895
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 // Otherwise we have to copy everything that is remaining into our
// internal buffer and then return a slice from that // 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 { if self.buf.capacity() < len {
self.buf.reserve(len - self.buf.capacity()); 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 // Otherwise we have to copy everything that is remaining into our
// internal buffer and then return a slice from that // 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 { if self.buf.capacity() < len {
self.buf.reserve(len - self.buf.capacity()); self.buf.reserve(len - self.buf.capacity());
} }