mirror of
https://github.com/launchbadge/sqlx
synced 2024-11-10 14:34:19 +00:00
Use advance instead of set in read loop
This commit is contained in:
parent
28168c414d
commit
3599d50811
1 changed files with 2 additions and 2 deletions
|
@ -110,8 +110,8 @@ impl Connection {
|
|||
let n = self.stream.read(unsafe { self.rbuf.bytes_mut() }).await?;
|
||||
|
||||
// SAFE: After we read in N bytes, we can tell the buffer that it actually
|
||||
// has that many bytes for the decode routines to look at
|
||||
unsafe { self.rbuf.set_len(n) }
|
||||
// has that many bytes MORE for the decode routines to look at
|
||||
unsafe { self.rbuf.advance_mut(n) }
|
||||
|
||||
if n == 0 {
|
||||
self.stream_eof = true;
|
||||
|
|
Loading…
Reference in a new issue