Skip to content

Commit 128848a

Browse files
committed
hx conf, fmt
Signed-off-by: Onur Satici <[email protected]>
1 parent d0ae232 commit 128848a

File tree

5 files changed

+22
-13
lines changed

5 files changed

+22
-13
lines changed

.helix/languages.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
[language-server.rust-analyzer.config]
2+
cargo = { target = "x86_64-unknown-linux-gnu", features = "all" }
3+
checkOnSave = { extraArgs = ["--target", "x86_64-unknown-linux-gnu"] }

bench-vortex/src/lib.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,11 @@ pub fn configure_runtime(choice: Option<RuntimeChoice>) {
7676
}
7777

7878
fn make_session() -> VortexSession {
79-
match RUNTIME_OVERRIDE.get().copied().unwrap_or(RuntimeChoice::Tokio) {
79+
match RUNTIME_OVERRIDE
80+
.get()
81+
.copied()
82+
.unwrap_or(RuntimeChoice::Tokio)
83+
{
8084
RuntimeChoice::Tokio => VortexSession::default().with_tokio(),
8185
#[cfg(all(feature = "uring", target_os = "linux"))]
8286
RuntimeChoice::Uring => {

vortex-io/src/file/std_file.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,9 @@ use crate::file::IntoReadSource;
2727
use crate::file::IoRequest;
2828
use crate::file::ReadSource;
2929
use crate::file::ReadSourceRef;
30-
use crate::runtime::Handle;
3130
#[cfg(all(target_os = "linux", feature = "uring"))]
3231
use crate::file::uring_file::open_uring_read_source;
32+
use crate::runtime::Handle;
3333

3434
/// Read exactly `buffer.len()` bytes from `file` starting at `offset`.
3535
/// This is a platform-specific helper that uses the most efficient method available.

vortex-io/src/file/uring_file.rs

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,8 +72,13 @@ impl ReadSource for UringFileIoSource {
7272

7373
fn size(&self) -> BoxFuture<'static, VortexResult<u64>> {
7474
let std_file = self.std_file.clone();
75-
futures::future::ready(std_file.metadata().map(|m| m.len()).map_err(VortexError::from))
76-
.boxed()
75+
futures::future::ready(
76+
std_file
77+
.metadata()
78+
.map(|m| m.len())
79+
.map_err(VortexError::from),
80+
)
81+
.boxed()
7782
}
7883

7984
fn drive_send(

vortex-io/src/runtime/uring.rs

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@ use std::thread;
1515
use futures::future::BoxFuture;
1616
use kanal::Receiver;
1717
use kanal::Sender;
18-
use monoio::RuntimeBuilder;
1918
use monoio::IoUringDriver;
19+
use monoio::RuntimeBuilder;
2020
use vortex_error::vortex_panic;
2121

2222
use crate::runtime::AbortHandle;
@@ -78,7 +78,9 @@ impl LocalExecutor for HandleSetExecutor {
7878
fn spawn_local(&self, f: LocalSpawn) -> AbortHandleRef {
7979
match self.pick().as_local_executor() {
8080
Some(exec) => exec.spawn_local(f),
81-
None => vortex_panic!("LocalExecutor requested but not supported by any underlying executor"),
81+
None => vortex_panic!(
82+
"LocalExecutor requested but not supported by any underlying executor"
83+
),
8284
}
8385
}
8486
}
@@ -93,9 +95,7 @@ pub(crate) struct HandleSet {
9395
impl HandleSet {
9496
pub(crate) fn new(executors: Vec<Arc<dyn Executor>>) -> Self {
9597
let executors: Arc<[Arc<dyn Executor>]> = executors.into();
96-
let dispatcher = Arc::new(HandleSetExecutor::new(
97-
executors.iter().cloned().collect(),
98-
));
98+
let dispatcher = Arc::new(HandleSetExecutor::new(executors.iter().cloned().collect()));
9999
Self {
100100
executors,
101101
dispatcher,
@@ -116,10 +116,7 @@ impl HandleSet {
116116

117117
/// Create a [`Handle`] that dispatches work round-robin across the provided handles.
118118
pub fn dispatching_handle(handles: &[Handle]) -> Handle {
119-
let executors = handles
120-
.iter()
121-
.map(|h| h.runtime())
122-
.collect::<Vec<_>>();
119+
let executors = handles.iter().map(|h| h.runtime()).collect::<Vec<_>>();
123120
let set = HandleSet::new(executors);
124121
set.dispatching_handle()
125122
}

0 commit comments

Comments
 (0)