mirror of
https://github.com/Noratrieb/ice-104649.git
synced 2026-01-16 13:25:03 +01:00
lol no futures
This commit is contained in:
parent
5617c76385
commit
a226e71cde
1 changed files with 7 additions and 8 deletions
15
src/main.rs
15
src/main.rs
|
|
@ -43,15 +43,14 @@ mod fut {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
pub struct Empty;
|
pub fn map<T, F>(f: F) -> Map<F>
|
||||||
|
where
|
||||||
impl Stream for Empty {
|
F: FnMut(String) -> T,
|
||||||
type Item = String;
|
{
|
||||||
|
loop {}
|
||||||
}
|
}
|
||||||
|
|
||||||
pub struct Map<F> {
|
pub struct Map<F>(F);
|
||||||
f: F,
|
|
||||||
}
|
|
||||||
|
|
||||||
pub trait FnOnce1<A> {
|
pub trait FnOnce1<A> {
|
||||||
type Output;
|
type Output;
|
||||||
|
|
@ -97,7 +96,7 @@ mod fut {
|
||||||
}
|
}
|
||||||
|
|
||||||
fn main() {
|
fn main() {
|
||||||
let bodies = fut::Empty.map(|url| FutResult(Result::Ok(url)));
|
let bodies = fut::map(|url| FutResult(Result::Ok(url)));
|
||||||
|
|
||||||
bodies.for_each(|b| async {
|
bodies.for_each(|b| async {
|
||||||
match b {
|
match b {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue