From 3df0743bdffa5a45a3ed6aa3c3905b9cb417fe4b Mon Sep 17 00:00:00 2001 From: Ryan Leckey Date: Mon, 22 Feb 2021 23:02:44 -0800 Subject: [PATCH] fix(core): use cmp::max instead of infix max --- sqlx-core/src/io/buf_stream.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sqlx-core/src/io/buf_stream.rs b/sqlx-core/src/io/buf_stream.rs index f52a456f..274594b8 100644 --- a/sqlx-core/src/io/buf_stream.rs +++ b/sqlx-core/src/io/buf_stream.rs @@ -1,4 +1,5 @@ use std::marker::PhantomData; +use std::cmp; use std::ops::{Deref, DerefMut}; use bytes::{Bytes, BytesMut}; @@ -77,7 +78,7 @@ macro_rules! read { // while our read buffer is too small to satisfy the requested amount while $self.rbuf.len() < ($offset + $n) { // ensure that there is room in the read buffer - $self.rbuf.reserve($n.max(128)); + $self.rbuf.reserve(cmp::max($n, 128)); #[allow(unsafe_code)] unsafe {