Commit graph

3 commits

Author SHA1 Message Date
Daniel Verkamp
ac6fe3e31c Avoid clippy::blocks_in_conditions warnings
Assign the result of function calls that take closures to an
intermediate variable rather than matching on it directly to simplify
the complexity from clippy's point of view.

BUG=b:344974550
TEST=tools/clippy

Change-Id: I0e4b4201b59d8bd972c1f18e65bfd501893d58e5
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/5617618
Commit-Queue: Daniel Verkamp <dverkamp@chromium.org>
Reviewed-by: Frederick Mayle <fmayle@google.com>
2024-06-11 00:18:47 +00:00
Frederick Mayle
66e37a886d base_tokio: tube: require &mut self for send/recv
`base::Tube` probably ought to require `&mut self` (or be `!Sync`) since
it isn't safe to concurrently send or recv. Let's try to be stricter in
the new API, esp. since it requires non-trivial effort to port code to
this library, needing to manage tubes slightly differently shouldn't be
a big deal.

BUG=b:338274203

Change-Id: I7caf743744393aedf0a346ca23e970d15020704c
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/5604651
Commit-Queue: Frederick Mayle <fmayle@google.com>
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
2024-06-06 23:30:53 +00:00
Frederick Mayle
7ec3293ab4 base_tokio: tokio compatible Event and Tube types
BUG=b:338274203

Change-Id: I6fbce1386c2c086d7a53a706018d959f4fadfada
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/5507771
Reviewed-by: Noah Gold <nkgold@google.com>
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
Commit-Queue: Frederick Mayle <fmayle@google.com>
2024-06-06 23:30:20 +00:00