-
Notifications
You must be signed in to change notification settings - Fork 237
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
linux clippy fixes + adding additional dummy ipr types for better lin…
…ting on non-linux targets
- Loading branch information
Showing
3 changed files
with
58 additions
and
33 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
// Copyright 2024 - Nym Technologies SA <[email protected]> | ||
// SPDX-License-Identifier: Apache-2.0 | ||
|
||
use std::io::Error; | ||
use std::pin::Pin; | ||
use std::task::{Context, Poll}; | ||
use tokio::io::{AsyncRead, AsyncWrite, ReadBuf}; | ||
|
||
pub(crate) struct DummyDevice; | ||
|
||
impl AsyncRead for DummyDevice { | ||
fn poll_read( | ||
self: Pin<&mut Self>, | ||
_cx: &mut Context<'_>, | ||
_buf: &mut ReadBuf<'_>, | ||
) -> Poll<std::io::Result<()>> { | ||
unimplemented!("tunnel devices are not supported by non-linux targets") | ||
} | ||
} | ||
|
||
impl AsyncWrite for DummyDevice { | ||
fn poll_write( | ||
self: Pin<&mut Self>, | ||
_cx: &mut Context<'_>, | ||
_buf: &[u8], | ||
) -> Poll<std::result::Result<usize, Error>> { | ||
unimplemented!("tunnel devices are not supported by non-linux targets") | ||
} | ||
|
||
fn poll_flush( | ||
self: Pin<&mut Self>, | ||
_cx: &mut Context<'_>, | ||
) -> Poll<std::result::Result<(), Error>> { | ||
unimplemented!("tunnel devices are not supported by non-linux targets") | ||
} | ||
|
||
fn poll_shutdown( | ||
self: Pin<&mut Self>, | ||
_cx: &mut Context<'_>, | ||
) -> Poll<std::result::Result<(), Error>> { | ||
unimplemented!("tunnel devices are not supported by non-linux targets") | ||
} | ||
} |