Mark version specific API logic with compiler feature attributes

This commit is contained in:
timvisee 2019-02-28 00:07:43 +01:00
parent 4cfc9b16b6
commit 2236801f64
No known key found for this signature in database
GPG key ID: B8DB720BC383E172
2 changed files with 4 additions and 1 deletions

View file

@ -49,7 +49,7 @@ impl<'a> Upload<'a> {
let matcher_upload = UploadMatcher::with(self.cmd_matches).unwrap();
// Get API parameters
let mut path = Path::new(matcher_upload.file()).to_path_buf();
let path = Path::new(matcher_upload.file()).to_path_buf();
let host = matcher_upload.host();
// Create a reqwest client capable for uploading files

View file

@ -11,4 +11,7 @@ pub const CLIENT_TRANSFER_TIMEOUT: u64 = 24 * 60 * 60;
pub const API_VERSION_DESIRED_DEFAULT: DesiredVersion = DesiredVersion::Assume(API_VERSION_ASSUME);
/// The default server API version to assume when it could not be determined.
#[cfg(feature = "send2")]
pub const API_VERSION_ASSUME: Version = Version::V2;
#[cfg(not(feature = "send2"))]
pub const API_VERSION_ASSUME: Version = Version::V3;