Skip to content

Commit 3775d98

Browse files
committed
refactor: avoid ** syntax
Signed-off-by: Roman Volosatovs <[email protected]>
1 parent bbb4f9d commit 3775d98

File tree

4 files changed

+17
-17
lines changed

4 files changed

+17
-17
lines changed

crates/wasi/src/cli.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,31 +18,31 @@ pub trait IsTerminal {
1818

1919
impl<T: ?Sized + IsTerminal> IsTerminal for &T {
2020
fn is_terminal(&self) -> bool {
21-
(**self).is_terminal()
21+
T::is_terminal(self)
2222
}
2323
}
2424

2525
impl<T: ?Sized + IsTerminal> IsTerminal for &mut T {
2626
fn is_terminal(&self) -> bool {
27-
(**self).is_terminal()
27+
T::is_terminal(self)
2828
}
2929
}
3030

3131
impl<T: ?Sized + IsTerminal> IsTerminal for Box<T> {
3232
fn is_terminal(&self) -> bool {
33-
(**self).is_terminal()
33+
T::is_terminal(self)
3434
}
3535
}
3636

3737
impl<T: ?Sized + IsTerminal> IsTerminal for Rc<T> {
3838
fn is_terminal(&self) -> bool {
39-
(**self).is_terminal()
39+
T::is_terminal(self)
4040
}
4141
}
4242

4343
impl<T: ?Sized + IsTerminal> IsTerminal for Arc<T> {
4444
fn is_terminal(&self) -> bool {
45-
(**self).is_terminal()
45+
T::is_terminal(self)
4646
}
4747
}
4848

crates/wasi/src/clocks.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,13 @@ pub struct WasiClocksImpl<T>(pub T);
77

88
impl<T: WasiClocksView> WasiClocksView for &mut T {
99
fn clocks(&mut self) -> &WasiClocksCtx {
10-
(**self).clocks()
10+
T::clocks(self)
1111
}
1212
}
1313

1414
impl<T: WasiClocksView> WasiClocksView for Box<T> {
1515
fn clocks(&mut self) -> &WasiClocksCtx {
16-
(**self).clocks()
16+
T::clocks(self)
1717
}
1818
}
1919

crates/wasi/src/p3/cli/mod.rs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -147,25 +147,25 @@ pub trait InputStream: IsTerminal + Send {
147147

148148
impl<T: ?Sized + InputStream + Sync> InputStream for &T {
149149
fn reader(&self) -> Box<dyn AsyncRead + Send + Sync> {
150-
(**self).reader()
150+
T::reader(self)
151151
}
152152
}
153153

154154
impl<T: ?Sized + InputStream> InputStream for &mut T {
155155
fn reader(&self) -> Box<dyn AsyncRead + Send + Sync> {
156-
(**self).reader()
156+
T::reader(self)
157157
}
158158
}
159159

160160
impl<T: ?Sized + InputStream> InputStream for Box<T> {
161161
fn reader(&self) -> Box<dyn AsyncRead + Send + Sync> {
162-
(**self).reader()
162+
T::reader(self)
163163
}
164164
}
165165

166166
impl<T: ?Sized + InputStream + Sync> InputStream for Arc<T> {
167167
fn reader(&self) -> Box<dyn AsyncRead + Send + Sync> {
168-
(**self).reader()
168+
T::reader(self)
169169
}
170170
}
171171

@@ -199,25 +199,25 @@ pub trait OutputStream: IsTerminal + Send {
199199

200200
impl<T: ?Sized + OutputStream + Sync> OutputStream for &T {
201201
fn writer(&self) -> Box<dyn AsyncWrite + Send + Sync> {
202-
(**self).writer()
202+
T::writer(self)
203203
}
204204
}
205205

206206
impl<T: ?Sized + OutputStream> OutputStream for &mut T {
207207
fn writer(&self) -> Box<dyn AsyncWrite + Send + Sync> {
208-
(**self).writer()
208+
T::writer(self)
209209
}
210210
}
211211

212212
impl<T: ?Sized + OutputStream> OutputStream for Box<T> {
213213
fn writer(&self) -> Box<dyn AsyncWrite + Send + Sync> {
214-
(**self).writer()
214+
T::writer(self)
215215
}
216216
}
217217

218218
impl<T: ?Sized + OutputStream + Sync> OutputStream for Arc<T> {
219219
fn writer(&self) -> Box<dyn AsyncWrite + Send + Sync> {
220-
(**self).writer()
220+
T::writer(self)
221221
}
222222
}
223223

crates/wasi/src/random.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,13 @@ pub struct WasiRandomImpl<T>(pub T);
55

66
impl<T: WasiRandomView> WasiRandomView for &mut T {
77
fn random(&mut self) -> &mut WasiRandomCtx {
8-
(**self).random()
8+
T::random(self)
99
}
1010
}
1111

1212
impl<T: WasiRandomView> WasiRandomView for Box<T> {
1313
fn random(&mut self) -> &mut WasiRandomCtx {
14-
(**self).random()
14+
T::random(self)
1515
}
1616
}
1717

0 commit comments

Comments
 (0)