You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
error[E0502]: cannot borrow `buf` as mutable because it is also borrowed as immutable
--> src/http.rs:44:33
|
44 | let total = stream.read(&mut buf).await?;
| ^^^^^^^^ mutable borrow occurs here
45 | let result = response.parse(&buf[..total]);
| -------- --- immutable borrow occurs here
| |
| immutable borrow later used here
Since this crate has a kind of unique API, how would you recommend solving this issue?
The text was updated successfully, but these errors were encountered:
Hello, I'm trying to use this crate to implement a parser, but I'm having difficulties implementing response reading loop.
Here's my crate's code: https://github.com/MOZGIII/http-proxy-client-async
And I'm having issues with this section in particular:
https://github.com/MOZGIII/http-proxy-client-async/blob/d5d29ec06c5cd912e17ec358ee77860c7e8b4f61/src/http.rs#L39-L54
The issue is with borrowing the
buf
:Since this crate has a kind of unique API, how would you recommend solving this issue?
The text was updated successfully, but these errors were encountered: