diff --git a/Cargo.lock b/Cargo.lock index 33853ac..1dc5c80 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -553,7 +553,7 @@ dependencies = [ "url 1.7.2 (registry+https://github.com/rust-lang/crates.io-index)", "url_serde 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", "version-compare 0.0.6 (registry+https://github.com/rust-lang/crates.io-index)", - "websocket 0.22.2 (registry+https://github.com/rust-lang/crates.io-index)", + "websocket 0.22.2 (git+https://github.com/timvisee/rust-websocket.git)", ] [[package]] @@ -1954,7 +1954,7 @@ dependencies = [ [[package]] name = "websocket" version = "0.22.2" -source = "registry+https://github.com/rust-lang/crates.io-index" +source = "git+https://github.com/timvisee/rust-websocket.git#f3e3e1ec09b99198576dd9808fc350829ee55b85" dependencies = [ "base64 0.10.1 (registry+https://github.com/rust-lang/crates.io-index)", "bitflags 1.0.4 (registry+https://github.com/rust-lang/crates.io-index)", @@ -2252,7 +2252,7 @@ dependencies = [ "checksum version-compare 0.0.6 (registry+https://github.com/rust-lang/crates.io-index)" = "78068add8bf1e4d37d13fa5867182fe4c03f8e525c831053733f83aaba942d37" "checksum version_check 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)" = "914b1a6776c4c929a602fafd8bc742e06365d4bcbe48c30f9cca5824f70dc9dd" "checksum want 0.0.6 (registry+https://github.com/rust-lang/crates.io-index)" = "797464475f30ddb8830cc529aaaae648d581f99e2036a928877dfde027ddf6b3" -"checksum websocket 0.22.2 (registry+https://github.com/rust-lang/crates.io-index)" = "d2c67346c042adbd4f5b2a49700e340befc5b772094fec8d36df6b825523d933" +"checksum websocket 0.22.2 (git+https://github.com/timvisee/rust-websocket.git)" = "" "checksum winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)" = "167dc9d6949a9b857f3451275e911c3f44255842c1f7a76f33c55103a909087a" "checksum winapi 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)" = "92c1eb33641e276cfa214a0522acad57be5c56b10cb348b3c5117db75f3ac4b0" "checksum winapi-build 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "2d315eee3b34aca4797b2da6b13ed88266e6d612562a0c46390af8299fc699bc" diff --git a/src/action/download.rs b/src/action/download.rs index b912819..3fe6ff6 100644 --- a/src/action/download.rs +++ b/src/action/download.rs @@ -10,8 +10,7 @@ use failure::Fail; use ffsend_api::action::download::{Download as ApiDownload, Error as DownloadError}; use ffsend_api::action::exists::{Error as ExistsError, Exists as ApiExists}; use ffsend_api::action::metadata::{Error as MetadataError, Metadata as ApiMetadata}; -use ffsend_api::action::version::{Version as ApiVersion, Error as VersionError}; -use ffsend_api::api::Version; +use ffsend_api::action::version::Error as VersionError; use ffsend_api::file::remote_file::{FileParseError, RemoteFile}; use ffsend_api::pipe::ProgressReporter; #[cfg(feature = "archive")] diff --git a/src/action/upload.rs b/src/action/upload.rs index b755205..a89b0e4 100644 --- a/src/action/upload.rs +++ b/src/action/upload.rs @@ -8,8 +8,7 @@ use clap::ArgMatches; use failure::Fail; use ffsend_api::action::params::ParamsDataBuilder; use ffsend_api::action::upload::{Error as UploadError, Upload as ApiUpload}; -use ffsend_api::action::version::{Version as ApiVersion, Error as VersionError}; -use ffsend_api::api::Version; +use ffsend_api::action::version::Error as VersionError; use ffsend_api::config::{UPLOAD_SIZE_MAX, UPLOAD_SIZE_MAX_RECOMMENDED}; use ffsend_api::pipe::ProgressReporter; use prettytable::{format::FormatBuilder, Cell, Row, Table}; @@ -18,7 +17,7 @@ use tempfile::{Builder as TempBuilder, NamedTempFile}; #[cfg(feature = "archive")] use crate::archive::archiver::Archiver; -use crate::client::{create_client, create_transfer_client}; +use crate::client::create_transfer_client; use crate::cmd::matcher::{MainMatcher, Matcher, UploadMatcher}; #[cfg(feature = "history")] use crate::history_tool; diff --git a/src/action/version.rs b/src/action/version.rs index df2420a..dc3aea5 100644 --- a/src/action/version.rs +++ b/src/action/version.rs @@ -1,13 +1,10 @@ use clap::ArgMatches; use ffsend_api::action::version::{Error as VersionError, Version as ApiVersion}; -use ffsend_api::file::remote_file::{FileParseError, RemoteFile}; use crate::client::create_client; use crate::cmd::matcher::main::MainMatcher; use crate::cmd::matcher::{version::VersionMatcher, Matcher}; use crate::error::ActionError; -#[cfg(feature = "history")] -use crate::history_tool; /// A file version action. pub struct Version<'a> { diff --git a/src/cmd/arg/api.rs b/src/cmd/arg/api.rs index 0a9b620..b65cd36 100644 --- a/src/cmd/arg/api.rs +++ b/src/cmd/arg/api.rs @@ -1,11 +1,8 @@ use clap::{Arg, ArgMatches}; -use failure::Fail; use ffsend_api::api::{DesiredVersion, Version}; -use ffsend_api::url::Url; use super::{CmdArg, CmdArgOption}; use crate::config::API_VERSION_DESIRED_DEFAULT; -use crate::util::{quit_error, ErrorHints}; /// The api argument. pub struct ArgApi {} @@ -45,7 +42,7 @@ impl<'a> CmdArgOption<'a> for ArgApi { // Parse the given API version match Version::parse(version) { Ok(version) => DesiredVersion::Use(version), - Err(err) => { + Err(_) => { panic!("failed to determine given server API version, version unknown"); // TODO: properly quit with an application error instead diff --git a/src/util.rs b/src/util.rs index 5809e52..637bb6d 100644 --- a/src/util.rs +++ b/src/util.rs @@ -751,6 +751,10 @@ pub fn features_list() -> Vec<&'static str> { features.push("history"); #[cfg(feature = "no-color")] features.push("no-color"); + #[cfg(feature = "send2")] + features.push("send2"); + #[cfg(feature = "send3")] + features.push("send3"); features }