Commit Graph
2 Commits
Author SHA1 Message Date
David KoloskiandDavid Koloski 0d4d3c34f1 sync: replace non-binding if let statements (#4735)
Found some `if let` statements that don't actually bind any variables.
This can make it somewhat confusing as to whether the pattern is binding
the value or being matched against. Switching to `matches!` and equality
comparisons allow these to be removed.

Co-authored-by: David Koloski <[email protected]>
2022-06-03 09:41:16 +02:00
David KoloskiandDavid Koloski cc6c2f40cb tokio: check page capacity before obtaining base pointer (#4731)
This doesn't cause any issues in practice because this is a private API
that is only used in ways that cannot trigger UB. Indexing into `slots`
is not sound until after we've asserted that the page is allocated,
since that aliases the first slot which may not be allocated. This PR
also switches to using `as_ptr` to obtain the base pointer for clarity.

Co-authored-by: David Koloski <[email protected]>
2022-06-01 21:18:06 +02:00