Skip to content

Commit

Permalink
fix: drop RefCell mutable borrow early
Browse files Browse the repository at this point in the history
  • Loading branch information
mxinden committed May 3, 2024
1 parent 257125a commit 8d66880
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions neqo-transport/src/streams.rs
Original file line number Diff line number Diff line change
Expand Up @@ -477,10 +477,12 @@ impl Streams {

pub fn handle_max_data(&mut self, maximum_data: u64) {
let previous_limit = self.sender_fc.borrow().available();
if let Some(current_limit) = self.sender_fc.borrow_mut().update(maximum_data) {
for (_id, ss) in &mut self.send {
ss.maybe_emit_writable_event(previous_limit, current_limit);
}
let Some(current_limit) = self.sender_fc.borrow_mut().update(maximum_data) else {
return;
};

for (_id, ss) in &mut self.send {
ss.maybe_emit_writable_event(previous_limit, current_limit);
}
}

Expand Down

0 comments on commit 8d66880

Please sign in to comment.