Skip to content

Commit 2a12bbc

Browse files
committed
Fix clippy
1 parent 869842a commit 2a12bbc

5 files changed

Lines changed: 18 additions & 23 deletions

File tree

vortex-io/src/file/driver.rs

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,14 @@ use std::pin::Pin;
55
use std::task::{Context, Poll};
66

77
use futures::Stream;
8+
#[cfg(all(test, not(feature = "tokio")))]
9+
use oneshot;
810
use pin_project_lite::pin_project;
9-
use vortex_error::VortexExpect;
10-
use vortex_metrics::VortexMetrics;
11-
1211
// Prefer tokio::sync::oneshot when tokio feature is enabled
1312
#[cfg(all(test, feature = "tokio"))]
1413
use tokio::sync::oneshot;
15-
#[cfg(all(test, not(feature = "tokio")))]
16-
use oneshot;
14+
use vortex_error::VortexExpect;
15+
use vortex_metrics::VortexMetrics;
1716

1817
use crate::file::read::{
1918
CoalesceWindow, CoalescedRequest, IoRequest, ReadEvent, ReadRequest, RequestId,

vortex-io/src/file/read/mod.rs

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,16 +15,15 @@ use async_trait::async_trait;
1515
use futures::channel::mpsc;
1616
use futures::future::{BoxFuture, Shared};
1717
use futures::{FutureExt, TryFutureExt};
18+
#[cfg(not(feature = "tokio"))]
19+
use oneshot;
1820
pub use request::*;
1921
pub use source::*;
20-
use vortex_buffer::{Alignment, ByteBuffer};
21-
use vortex_error::{SharedVortexResult, VortexError, VortexResult, vortex_err};
22-
2322
// Prefer tokio::sync::oneshot when tokio feature is enabled
2423
#[cfg(feature = "tokio")]
2524
use tokio::sync::oneshot;
26-
#[cfg(not(feature = "tokio"))]
27-
use oneshot;
25+
use vortex_buffer::{Alignment, ByteBuffer};
26+
use vortex_error::{SharedVortexResult, VortexError, VortexResult, vortex_err};
2827

2928
use crate::VortexReadAt;
3029

vortex-io/src/file/read/request.rs

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,13 @@ use std::fmt::{Debug, Formatter};
66
use std::ops::Range;
77
use std::sync::Arc;
88

9-
use vortex_buffer::{Alignment, ByteBuffer};
10-
use vortex_error::{VortexError, VortexExpect, VortexResult};
11-
9+
#[cfg(not(feature = "tokio"))]
10+
use oneshot;
1211
// Prefer tokio::sync::oneshot when tokio feature is enabled
1312
#[cfg(feature = "tokio")]
1413
use tokio::sync::oneshot;
15-
#[cfg(not(feature = "tokio"))]
16-
use oneshot;
14+
use vortex_buffer::{Alignment, ByteBuffer};
15+
use vortex_error::{VortexError, VortexExpect, VortexResult};
1716

1817
/// An I/O request, either a single read or a coalesced set of reads.
1918
pub struct IoRequest(IoRequestInner);

vortex-io/src/runtime/handle.rs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,12 @@ use std::task::{Context, Poll, ready};
77

88
use futures::channel::mpsc;
99
use futures::{FutureExt, StreamExt};
10-
use vortex_error::{VortexResult, vortex_panic};
11-
10+
#[cfg(not(feature = "tokio"))]
11+
use oneshot;
1212
// Prefer tokio::sync::oneshot when tokio feature is enabled
1313
#[cfg(feature = "tokio")]
1414
use tokio::sync::oneshot;
15-
#[cfg(not(feature = "tokio"))]
16-
use oneshot;
15+
use vortex_error::{VortexResult, vortex_panic};
1716
use vortex_metrics::VortexMetrics;
1817

1918
use crate::file::{FileRead, IntoReadSource, IoRequestStream};

vortex-io/src/runtime/single.rs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,14 @@ use std::sync::Arc;
77
use futures::future::BoxFuture;
88
use futures::stream::LocalBoxStream;
99
use futures::{Stream, StreamExt};
10+
#[cfg(not(feature = "tokio"))]
11+
use oneshot;
1012
use parking_lot::Mutex;
1113
use smol::LocalExecutor;
12-
use vortex_error::vortex_panic;
13-
1414
// Prefer tokio::sync::oneshot when tokio feature is enabled
1515
#[cfg(feature = "tokio")]
1616
use tokio::sync::oneshot;
17-
#[cfg(not(feature = "tokio"))]
18-
use oneshot;
17+
use vortex_error::vortex_panic;
1918

2019
use crate::runtime::smol::SmolAbortHandle;
2120
use crate::runtime::{AbortHandle, AbortHandleRef, BlockingRuntime, Executor, Handle, IoTask};

0 commit comments

Comments
 (0)