Skip to content

Commit 14443af

Browse files
committed
make trait bound nicer
1 parent cdb176e commit 14443af

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

tokio/src/runtime/driver/op.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ pub(crate) enum State {
3434
Complete,
3535
}
3636

37-
pub(crate) struct Op<T: Cancellable + Send + 'static> {
37+
pub(crate) struct Op<T: Cancellable> {
3838
// Handle to the runtime
3939
handle: Handle,
4040
// State of this Op
@@ -43,7 +43,7 @@ pub(crate) struct Op<T: Cancellable + Send + 'static> {
4343
data: Option<T>,
4444
}
4545

46-
impl<T: Cancellable + Send + 'static> Op<T> {
46+
impl<T: Cancellable> Op<T> {
4747
/// # Safety
4848
///
4949
/// Callers must ensure that parameters of the entry (such as buffer) are valid and will
@@ -62,7 +62,7 @@ impl<T: Cancellable + Send + 'static> Op<T> {
6262
}
6363
}
6464

65-
impl<T: Cancellable + Send + 'static> Drop for Op<T> {
65+
impl<T: Cancellable> Drop for Op<T> {
6666
fn drop(&mut self) {
6767
match self.state {
6868
// We've already dropped this Op.
@@ -109,7 +109,7 @@ pub(crate) trait Cancellable {
109109
fn cancell(self) -> CancelData;
110110
}
111111

112-
impl<T: Cancellable + Send + 'static> Unpin for Op<T> {}
112+
impl<T: Cancellable> Unpin for Op<T> {}
113113

114114
impl<T: Cancellable + Completable + Send> Future for Op<T> {
115115
type Output = io::Result<T::Output>;

tokio/src/runtime/io/driver/uring.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,7 @@ impl Handle {
168168

169169
// TODO: Remove this annotation when operations are actually supported
170170
#[allow(unused_variables, unreachable_code)]
171-
pub(crate) fn cancel_op<T: Cancellable + Send + 'static>(&self, index: usize, data: Option<T>) {
171+
pub(crate) fn cancel_op<T: Cancellable>(&self, index: usize, data: Option<T>) {
172172
let mut guard = self.get_uring().lock();
173173
let ctx = &mut *guard;
174174
let ops = &mut ctx.ops;

0 commit comments

Comments
 (0)