Skip to content

Commit 8ae07e7

Browse files
Thomasdezeeuwcramertj
authored andcommitted
Use Io instead of IO for generic type
1 parent 71aa691 commit 8ae07e7

File tree

2 files changed

+21
-21
lines changed

2 files changed

+21
-21
lines changed

futures-test/src/io/interleave_pending.rs

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -12,45 +12,45 @@ use std::{
1212
/// [`interleave_pending`]: super::AsyncReadTestExt::interleave_pending
1313
/// [`interleave_pending_write`]: super::AsyncWriteTestExt::interleave_pending_write
1414
#[derive(Debug)]
15-
pub struct InterleavePending<IO> {
16-
io: IO,
15+
pub struct InterleavePending<Io> {
16+
io: Io,
1717
pended: bool,
1818
}
1919

20-
impl<IO: Unpin> Unpin for InterleavePending<IO> {}
20+
impl<Io: Unpin> Unpin for InterleavePending<Io> {}
2121

22-
impl<IO> InterleavePending<IO> {
23-
unsafe_pinned!(io: IO);
22+
impl<Io> InterleavePending<Io> {
23+
unsafe_pinned!(io: Io);
2424
unsafe_unpinned!(pended: bool);
2525

26-
pub(crate) fn new(io: IO) -> Self {
26+
pub(crate) fn new(io: Io) -> Self {
2727
Self { io, pended: false }
2828
}
2929

3030
/// Acquires a reference to the underlying I/O object that this adaptor is
3131
/// wrapping.
32-
pub fn get_ref(&self) -> &IO {
32+
pub fn get_ref(&self) -> &Io {
3333
&self.io
3434
}
3535

3636
/// Acquires a mutable reference to the underlying I/O object that this
3737
/// adaptor is wrapping.
38-
pub fn get_mut(&mut self) -> &mut IO {
38+
pub fn get_mut(&mut self) -> &mut Io {
3939
&mut self.io
4040
}
4141

4242
/// Acquires a pinned mutable reference to the underlying I/O object that
4343
/// this adaptor is wrapping.
44-
pub fn get_pin_mut<'a>(self: Pin<&'a mut Self>) -> Pin<&'a mut IO> {
44+
pub fn get_pin_mut<'a>(self: Pin<&'a mut Self>) -> Pin<&'a mut Io> {
4545
self.project().0
4646
}
4747

4848
/// Consumes this adaptor returning the underlying I/O object.
49-
pub fn into_inner(self) -> IO {
49+
pub fn into_inner(self) -> Io {
5050
self.io
5151
}
5252

53-
fn project<'a>(self: Pin<&'a mut Self>) -> (Pin<&'a mut IO>, &'a mut bool) {
53+
fn project<'a>(self: Pin<&'a mut Self>) -> (Pin<&'a mut Io>, &'a mut bool) {
5454
unsafe {
5555
let this = self.get_unchecked_mut();
5656
(Pin::new_unchecked(&mut this.io), &mut this.pended)

futures-test/src/io/limited.rs

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -13,41 +13,41 @@ use std::{
1313
/// [`limited`]: super::AsyncReadTestExt::limited
1414
/// [`limited_write`]: super::AsyncWriteTestExt::limited_write
1515
#[derive(Debug)]
16-
pub struct Limited<IO> {
17-
io: IO,
16+
pub struct Limited<Io> {
17+
io: Io,
1818
limit: usize,
1919
}
2020

21-
impl<IO: Unpin> Unpin for Limited<IO> {}
21+
impl<Io: Unpin> Unpin for Limited<Io> {}
2222

23-
impl<IO> Limited<IO> {
24-
unsafe_pinned!(io: IO);
23+
impl<Io> Limited<Io> {
24+
unsafe_pinned!(io: Io);
2525
unsafe_unpinned!(limit: usize);
2626

27-
pub(crate) fn new(io: IO, limit: usize) -> Limited<IO> {
27+
pub(crate) fn new(io: Io, limit: usize) -> Limited<Io> {
2828
Limited { io, limit }
2929
}
3030

3131
/// Acquires a reference to the underlying I/O object that this adaptor is
3232
/// wrapping.
33-
pub fn get_ref(&self) -> &IO {
33+
pub fn get_ref(&self) -> &Io {
3434
&self.io
3535
}
3636

3737
/// Acquires a mutable reference to the underlying I/O object that this
3838
/// adaptor is wrapping.
39-
pub fn get_mut(&mut self) -> &mut IO {
39+
pub fn get_mut(&mut self) -> &mut Io {
4040
&mut self.io
4141
}
4242

4343
/// Acquires a pinned mutable reference to the underlying I/O object that
4444
/// this adaptor is wrapping.
45-
pub fn get_pin_mut<'a>(self: Pin<&'a mut Self>) -> Pin<&'a mut IO> {
45+
pub fn get_pin_mut<'a>(self: Pin<&'a mut Self>) -> Pin<&'a mut Io> {
4646
self.io()
4747
}
4848

4949
/// Consumes this adaptor returning the underlying I/O object.
50-
pub fn into_inner(self) -> IO {
50+
pub fn into_inner(self) -> Io {
5151
self.io
5252
}
5353
}

0 commit comments

Comments
 (0)