crosvm/cros_async
Takaya Saeki 9369814695 cros_async: make run_one utilize Executor::new
Currently, the utility function `run_one` has its own logic to create
`FdExecutor` and `UringExecutor`. However, this logic duplicates that of
`Executor::new`. So when you update the logic of `Executor::new`, you
must also update `run_one`, which is easy to forget and error-prone.

This commit updates `run_one` to delegate the executor building logic to
`Executor::new`. Also, the error type of `run_one` has been updated to
match `Executor::new`.

BUG=None
TEST=`cargo build` and `cargo test -p cros_async` succeeds.
TEST=windows build succeeds

Change-Id: Ic90a064c4c9017ed14e2897bccf68f9e275e1fef
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/3829220
Commit-Queue: Takaya Saeki <takayas@chromium.org>
Reviewed-by: Keiichi Watanabe <keiichiw@chromium.org>
2022-09-26 03:32:27 +00:00
..
src cros_async: make run_one utilize Executor::new 2022-09-26 03:32:27 +00:00
Cargo.toml