Remove unused imports, add Send version features to debug output

This commit is contained in:
timvisee 2019-02-27 23:17:03 +01:00
parent ca122cad66
commit 3bb0dc28dc
No known key found for this signature in database
GPG key ID: B8DB720BC383E172
6 changed files with 11 additions and 15 deletions

6
Cargo.lock generated
View file

@ -553,7 +553,7 @@ dependencies = [
"url 1.7.2 (registry+https://github.com/rust-lang/crates.io-index)", "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)", "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)", "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]] [[package]]
@ -1954,7 +1954,7 @@ dependencies = [
[[package]] [[package]]
name = "websocket" name = "websocket"
version = "0.22.2" 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 = [ dependencies = [
"base64 0.10.1 (registry+https://github.com/rust-lang/crates.io-index)", "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)", "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-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 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 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)" = "<none>"
"checksum winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)" = "167dc9d6949a9b857f3451275e911c3f44255842c1f7a76f33c55103a909087a" "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 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" "checksum winapi-build 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "2d315eee3b34aca4797b2da6b13ed88266e6d612562a0c46390af8299fc699bc"

View file

@ -10,8 +10,7 @@ use failure::Fail;
use ffsend_api::action::download::{Download as ApiDownload, Error as DownloadError}; 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::exists::{Error as ExistsError, Exists as ApiExists};
use ffsend_api::action::metadata::{Error as MetadataError, Metadata as ApiMetadata}; 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::action::version::Error as VersionError;
use ffsend_api::api::Version;
use ffsend_api::file::remote_file::{FileParseError, RemoteFile}; use ffsend_api::file::remote_file::{FileParseError, RemoteFile};
use ffsend_api::pipe::ProgressReporter; use ffsend_api::pipe::ProgressReporter;
#[cfg(feature = "archive")] #[cfg(feature = "archive")]

View file

@ -8,8 +8,7 @@ use clap::ArgMatches;
use failure::Fail; use failure::Fail;
use ffsend_api::action::params::ParamsDataBuilder; use ffsend_api::action::params::ParamsDataBuilder;
use ffsend_api::action::upload::{Error as UploadError, Upload as ApiUpload}; 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::action::version::Error as VersionError;
use ffsend_api::api::Version;
use ffsend_api::config::{UPLOAD_SIZE_MAX, UPLOAD_SIZE_MAX_RECOMMENDED}; use ffsend_api::config::{UPLOAD_SIZE_MAX, UPLOAD_SIZE_MAX_RECOMMENDED};
use ffsend_api::pipe::ProgressReporter; use ffsend_api::pipe::ProgressReporter;
use prettytable::{format::FormatBuilder, Cell, Row, Table}; use prettytable::{format::FormatBuilder, Cell, Row, Table};
@ -18,7 +17,7 @@ use tempfile::{Builder as TempBuilder, NamedTempFile};
#[cfg(feature = "archive")] #[cfg(feature = "archive")]
use crate::archive::archiver::Archiver; 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}; use crate::cmd::matcher::{MainMatcher, Matcher, UploadMatcher};
#[cfg(feature = "history")] #[cfg(feature = "history")]
use crate::history_tool; use crate::history_tool;

View file

@ -1,13 +1,10 @@
use clap::ArgMatches; use clap::ArgMatches;
use ffsend_api::action::version::{Error as VersionError, Version as ApiVersion}; 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::client::create_client;
use crate::cmd::matcher::main::MainMatcher; use crate::cmd::matcher::main::MainMatcher;
use crate::cmd::matcher::{version::VersionMatcher, Matcher}; use crate::cmd::matcher::{version::VersionMatcher, Matcher};
use crate::error::ActionError; use crate::error::ActionError;
#[cfg(feature = "history")]
use crate::history_tool;
/// A file version action. /// A file version action.
pub struct Version<'a> { pub struct Version<'a> {

View file

@ -1,11 +1,8 @@
use clap::{Arg, ArgMatches}; use clap::{Arg, ArgMatches};
use failure::Fail;
use ffsend_api::api::{DesiredVersion, Version}; use ffsend_api::api::{DesiredVersion, Version};
use ffsend_api::url::Url;
use super::{CmdArg, CmdArgOption}; use super::{CmdArg, CmdArgOption};
use crate::config::API_VERSION_DESIRED_DEFAULT; use crate::config::API_VERSION_DESIRED_DEFAULT;
use crate::util::{quit_error, ErrorHints};
/// The api argument. /// The api argument.
pub struct ArgApi {} pub struct ArgApi {}
@ -45,7 +42,7 @@ impl<'a> CmdArgOption<'a> for ArgApi {
// Parse the given API version // Parse the given API version
match Version::parse(version) { match Version::parse(version) {
Ok(version) => DesiredVersion::Use(version), Ok(version) => DesiredVersion::Use(version),
Err(err) => { Err(_) => {
panic!("failed to determine given server API version, version unknown"); panic!("failed to determine given server API version, version unknown");
// TODO: properly quit with an application error instead // TODO: properly quit with an application error instead

View file

@ -751,6 +751,10 @@ pub fn features_list() -> Vec<&'static str> {
features.push("history"); features.push("history");
#[cfg(feature = "no-color")] #[cfg(feature = "no-color")]
features.push("no-color"); features.push("no-color");
#[cfg(feature = "send2")]
features.push("send2");
#[cfg(feature = "send3")]
features.push("send3");
features features
} }