Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/windirstat/walkdir.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Gallant <jamslam@gmail.com>2017-10-21 04:34:02 +0300
committerAndrew Gallant <jamslam@gmail.com>2017-10-21 15:10:18 +0300
commitbc0ff47394875e31e098e88b36f7711a5fb26fa1 (patch)
treede4e85eb2d547d4f26a5881dc83760cbe4243c6e
parentf49cb038ac5459405a9d7f879c1410fe79451ab5 (diff)
examples: upgrade to docopt 0.8
-rw-r--r--Cargo.toml5
-rw-r--r--examples/walkdir.rs11
2 files changed, 10 insertions, 6 deletions
diff --git a/Cargo.toml b/Cargo.toml
index 8466780..11c87a7 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -24,7 +24,8 @@ kernel32-sys = "0.2"
winapi = "0.2"
[dev-dependencies]
-docopt = "0.7"
+docopt = "0.8"
quickcheck = { version = "0.4", default-features = false }
rand = "0.3"
-rustc-serialize = "0.3"
+serde = "1"
+serde_derive = "1"
diff --git a/examples/walkdir.rs b/examples/walkdir.rs
index d5d98d9..a0853e0 100644
--- a/examples/walkdir.rs
+++ b/examples/walkdir.rs
@@ -1,5 +1,7 @@
extern crate docopt;
-extern crate rustc_serialize;
+extern crate serde;
+#[macro_use]
+extern crate serde_derive;
extern crate walkdir;
use std::io::{self, Write};
@@ -23,7 +25,7 @@ Options:
-d, --depth Show directory's contents before the directory itself.
";
-#[derive(Debug, RustcDecodable)]
+#[derive(Debug, Deserialize)]
#[allow(dead_code)]
struct Args {
arg_dir: Option<String>,
@@ -40,8 +42,9 @@ struct Args {
macro_rules! wout { ($($tt:tt)*) => { {writeln!($($tt)*)}.unwrap() } }
fn main() {
- let args: Args = Docopt::new(USAGE).and_then(|d| d.decode())
- .unwrap_or_else(|e| e.exit());
+ let args: Args = Docopt::new(USAGE)
+ .and_then(|d| d.deserialize())
+ .unwrap_or_else(|e| e.exit());
let mind = args.flag_min_depth.unwrap_or(0);
let maxd = args.flag_max_depth.unwrap_or(::std::usize::MAX);
let dir = args.arg_dir.clone().unwrap_or(".".to_owned());