Advertisement
Guest User

Untitled

a guest
Feb 22nd, 2017
172
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Rust 0.67 KB | None | 0 0
  1. fn handle(rx: Receiver<DebouncedEvent>) {
  2.     loop {
  3.         match rx.recv() {
  4.             Ok(event) => {
  5.                 match event {
  6.                     DebouncedEvent::Create(file) => created(file),
  7.                     DebouncedEvent::Write(file) => created(file),
  8.                     DebouncedEvent::Remove(file) => removed(file),
  9.                     DebouncedEvent::Rename(from, to) => renamed(from, to),
  10.                     DebouncedEvent::Chmod(file) => created(file),
  11.                     _ => continue
  12.                 };
  13.             },
  14.             Err(e) => {
  15.                 println!("There was an error in rx.recv(): {}", e);
  16.             }
  17.         }
  18.     }
  19. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement