Advertisement
Guest User

Untitled

a guest
Jan 3rd, 2019
112
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Rust 0.37 KB | None | 0 0
  1. fn stuff(&mut self) -> impl Future<Output=()> {
  2.     self.coutner = 0;
  3.     future::lazy(|_| {
  4.         self.counter += 1;
  5.         // might be transformed to `self.counter = 1`, since we have a `&mut self`, its safe to assume noone else can edit/access this
  6.     })
  7. }
  8. fn stuff2(&mut self) -> impl Future<Output=()> {
  9.     future::lazy(|_| {
  10.         self.counter += 1;
  11.     })
  12. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement