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
Description of the problem:
In all the code listings in Chapter 20, a BufReader is used to read the HTTP request. The BufReader is initialized using a mutable borrow of TcpStream:
let buf_reader = BufReader::new(&mut stream);
However, it seems the mutable borrow isn't necessary here. The code works just fine when mut is removed. What's the consideration here?
Suggested fix:
Change the initialization to use immutable borrow.