Skip to content

Commit

Permalink
Fix dead code
Browse files Browse the repository at this point in the history
  • Loading branch information
raoulstrackx committed Feb 28, 2024
1 parent 898254c commit 2ddca2a
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 13 deletions.
2 changes: 2 additions & 0 deletions intel-sgx/aesm-client/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -284,6 +284,7 @@ impl EinittokenProvider for AesmClient {
trait AesmRequest: protobuf::Message + Into<Request> {
type Response: protobuf::Message + FromResponse;

#[cfg(not(target_env = "sgx"))]
fn get_timeout(&self) -> Option<u32>;
}

Expand All @@ -297,6 +298,7 @@ macro_rules! define_aesm_message {
impl AesmRequest for $request {
type Response = $response;

#[cfg(not(target_env = "sgx"))]
fn get_timeout(&self) -> Option<u32> {
if self.has_timeout() {
Some(Self::get_timeout(self))
Expand Down
13 changes: 0 additions & 13 deletions intel-sgx/enclave-runner/src/usercalls/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -120,19 +120,6 @@ impl AsyncRead for Stdin {
fn poll_read(self: Pin<&mut Self>, cx: &mut Context, buf: &mut [u8]) -> Poll<tokio::io::Result<usize>> {
const BUF_SIZE: usize = 8192;

trait AsIoResult<T> {
fn as_io_result(self) -> io::Result<T>;
}

impl<T> AsIoResult<T> for Poll<T> {
fn as_io_result(self) -> io::Result<T> {
match self {
Poll::Ready(v) => Ok(v),
Poll::Pending => Err(io::ErrorKind::WouldBlock.into()),
}
}
}

struct AsyncStdin {
rx: async_mpsc::Receiver<VecDeque<u8>>,
buf: VecDeque<u8>,
Expand Down

0 comments on commit 2ddca2a

Please sign in to comment.