#![deny(missing_docs)]
use std::ffi::OsString;
+use std::future::poll_fn;
use std::io;
use std::mem::{self, size_of, size_of_val, MaybeUninit};
use std::os::unix::ffi::{OsStrExt, OsStringExt};
use endian_trait::Endian;
use crate::format::{self, Header};
-use crate::poll_fn::poll_fn;
use crate::util::{self, io_err_other};
use crate::{Entry, EntryKind, Metadata};
#![deny(missing_docs)]
+use std::future::poll_fn;
use std::io;
use std::mem::{forget, size_of, size_of_val, take};
use std::os::unix::ffi::OsStrExt;
use crate::binary_tree_array;
use crate::decoder::{self, SeqRead};
use crate::format::{self, GoodbyeItem};
-use crate::poll_fn::poll_fn;
use crate::Metadata;
pub mod aio;
pub(crate) mod util;
-mod poll_fn;
-
pub mod accessor;
pub mod binary_tree_array;
pub mod decoder;
+++ /dev/null
-//! `poll_fn` reimplementation as it is otherwise the only thing we need from the futures crate.
-//!
-//! Our `futures` crate dependency is optional.
-
-use std::future::Future;
-use std::pin::Pin;
-use std::task::{Context, Poll};
-
-pub struct PollFn<F> {
- func: Option<F>,
-}
-
-pub fn poll_fn<F, R>(func: F) -> PollFn<F>
-where
- F: FnMut(&mut Context) -> Poll<R>,
-{
- PollFn { func: Some(func) }
-}
-
-impl<F, R> Future for PollFn<F>
-where
- F: FnMut(&mut Context) -> Poll<R>,
-{
- type Output = R;
-
- fn poll(self: Pin<&mut Self>, cx: &mut Context) -> Poll<Self::Output> {
- let this = unsafe { self.get_unchecked_mut() };
- match &mut this.func {
- None => panic!("poll() after Ready"),
- Some(func) => {
- let res = func(cx);
- if res.is_ready() {
- this.func = None;
- }
- res
- }
- }
- }
-}