From 10731c22f4bd6576bb4ea277bdf8b5a78ff86636 Mon Sep 17 00:00:00 2001 From: Edward Shen Date: Sun, 5 Jul 2020 00:54:38 -0400 Subject: [PATCH] remove yaml feature on clap, remove itertools --- Cargo.lock | 11 ----------- Cargo.toml | 3 +-- src/routes.rs | 5 ++--- 3 files changed, 3 insertions(+), 16 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index da68c78..eac858d 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -413,7 +413,6 @@ dependencies = [ "dirs 3.0.1 (registry+https://github.com/rust-lang/crates.io-index)", "handlebars 2.0.4 (registry+https://github.com/rust-lang/crates.io-index)", "hotwatch 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)", - "itertools 0.8.2 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", "percent-encoding 2.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "serde 1.0.114 (registry+https://github.com/rust-lang/crates.io-index)", @@ -485,7 +484,6 @@ dependencies = [ "textwrap 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)", "unicode-width 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)", "vec_map 0.8.2 (registry+https://github.com/rust-lang/crates.io-index)", - "yaml-rust 0.4.4 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -969,14 +967,6 @@ dependencies = [ "winreg 0.6.2 (registry+https://github.com/rust-lang/crates.io-index)", ] -[[package]] -name = "itertools" -version = "0.8.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "either 1.5.3 (registry+https://github.com/rust-lang/crates.io-index)", -] - [[package]] name = "itoa" version = "0.4.6" @@ -2057,7 +2047,6 @@ dependencies = [ "checksum inotify-sys 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)" = "e74a1aa87c59aeff6ef2cc2fa62d41bc43f54952f55652656b18a02fd5e356c0" "checksum iovec 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)" = "b2b3ea6ff95e175473f8ffe6a7eb7c00d054240321b84c57051175fe3c1e075e" "checksum ipconfig 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "f7e2f18aece9709094573a9f24f483c4f65caa4298e2f7ae1b71cc65d853fad7" -"checksum itertools 0.8.2 (registry+https://github.com/rust-lang/crates.io-index)" = "f56a2d0bc861f9165be4eb3442afd3c236d8a98afd426f65d92324ae1091a484" "checksum itoa 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)" = "dc6f3ad7b9d11a0c00842ff8de1b60ee58661048eb8049ed33c73594f359d7e6" "checksum kernel32-sys 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "7507624b29483431c0ba2d82aece8ca6cdba9382bff4ddd0f7490560c056098d" "checksum language-tags 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "a91d884b6667cd606bb5a69aa0c99ba811a115fc68915e7056ec08a46e93199a" diff --git a/Cargo.toml b/Cargo.toml index ae1b0d6..30ae456 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -18,10 +18,9 @@ serde_yaml = "0.8" handlebars = "2.0" hotwatch = "0.4" percent-encoding = "2.1" -itertools = "0.8" log = "0.4" simple_logger = "1.3" -clap = { version = "3.0.0-beta.1", features = ["yaml", "wrap_help"] } +clap = { version = "3.0.0-beta.1", features = ["wrap_help"] } [dev-dependencies] tempfile = "3.1" diff --git a/src/routes.rs b/src/routes.rs index 362126d..b8f0f9e 100644 --- a/src/routes.rs +++ b/src/routes.rs @@ -4,7 +4,6 @@ use actix_web::web::{Data, Query}; use actix_web::{get, http::header}; use actix_web::{HttpRequest, HttpResponse, Responder}; use handlebars::Handlebars; -use itertools::Itertools; use log::{debug, error}; use percent_encoding::{utf8_percent_encode, AsciiSet, CONTROLS}; use serde::Deserialize; @@ -156,7 +155,7 @@ fn resolve_hop<'a>( match split_args.next() { // Discard the first result, we found the route using the first arg Some(_) => { - let args = split_args.join(" "); + let args = split_args.collect::>().join(" "); debug!("Resolved {} with args {}", resolved, args); args } @@ -168,7 +167,7 @@ fn resolve_hop<'a>( ), // Unable to find route, but had a default route (None, Some(route)) => { - let args = split_args.join(" "); + let args = split_args.collect::>().join(" "); debug!("Using default route {} with args {}", route, args); match routes.get(route) { Some(v) => (Some(v), args),