mirror of https://github.com/MedzikUser/imgurs
Update dependencies and replace validator crate with url crate
This commit is contained in:
parent
e782617f08
commit
af0864d272
File diff suppressed because it is too large
Load Diff
|
@ -27,10 +27,10 @@ codegen-units = 1
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
# HTTP
|
# HTTP
|
||||||
reqwest = { version = "0.11", default-features = false, features = ["json", "multipart"] }
|
reqwest = { version = "0.12", default-features = false, features = ["json", "multipart"] }
|
||||||
# Request
|
# Request
|
||||||
base64 = "0.21"
|
base64 = "0.22"
|
||||||
validator = "0.16" # validate url address
|
url = "2.5.0" # validate url address
|
||||||
# Response
|
# Response
|
||||||
serde = { version = "1.0", features = ["derive"] }
|
serde = { version = "1.0", features = ["derive"] }
|
||||||
serde_json = "1.0"
|
serde_json = "1.0"
|
||||||
|
@ -40,4 +40,4 @@ thiserror = "1.0"
|
||||||
|
|
||||||
[dev-dependencies]
|
[dev-dependencies]
|
||||||
# Async tests
|
# Async tests
|
||||||
tokio = { version = "1.25", features = ["macros", "rt-multi-thread"] }
|
tokio = { version = "1.37", features = ["macros", "rt-multi-thread"] }
|
||||||
|
|
|
@ -16,11 +16,11 @@ path = "src/main.rs"
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
# Async runtime
|
# Async runtime
|
||||||
tokio = { version = "1.25", features = ["macros", "rt-multi-thread"] }
|
tokio = { version = "1.37", features = ["macros", "rt-multi-thread"] }
|
||||||
|
|
||||||
# CLI
|
# CLI
|
||||||
clap = { version = "4.1", features = ["derive"] }
|
clap = { version = "4.5", features = ["derive"] }
|
||||||
clap_complete = "4.1"
|
clap_complete = "4.5"
|
||||||
clap_mangen = "0.2"
|
clap_mangen = "0.2"
|
||||||
|
|
||||||
# Errors
|
# Errors
|
||||||
|
@ -28,19 +28,19 @@ anyhow = "1.0"
|
||||||
|
|
||||||
# Logger
|
# Logger
|
||||||
log = { version = "0.4", features = ["release_max_level_info"] }
|
log = { version = "0.4", features = ["release_max_level_info"] }
|
||||||
simple_logger = "4.0"
|
simple_logger = "4.3"
|
||||||
colored = "2.0"
|
colored = "2.1"
|
||||||
|
|
||||||
# Config
|
# Config
|
||||||
toml = "0.7"
|
toml = "0.8"
|
||||||
serde = { version = "1.0", features = ["derive"] }
|
serde = { version = "1.0", features = ["derive"] }
|
||||||
|
|
||||||
# Other
|
# Other
|
||||||
chrono = "0.4" # parse upload date
|
chrono = "0.4" # parse upload date
|
||||||
notify-rust = "4.7" # send notification after upload
|
notify-rust = "4.11" # send notification after upload
|
||||||
dirs = "4.0" # get system configuration directory
|
dirs = "5.0" # get system configuration directory
|
||||||
|
|
||||||
imgurs = { path = "..", version = "0.11.0", features = ["full"] }
|
imgurs = { path = "..", version = "0.11.0", features = ["full"] }
|
||||||
|
|
||||||
[target.'cfg(not(all(unix, not(any(target_os="macos", target_os="android", target_os="emscripten")))))'.dependencies]
|
[target.'cfg(not(all(unix, not(any(target_os="macos", target_os="android", target_os="emscripten")))))'.dependencies]
|
||||||
arboard = "3.2" # copy url to clipboard
|
arboard = "3.3" # copy url to clipboard
|
||||||
|
|
|
@ -9,6 +9,7 @@ pub(crate) use client::api_url;
|
||||||
pub use client::ImgurClient;
|
pub use client::ImgurClient;
|
||||||
pub use image_type::*;
|
pub use image_type::*;
|
||||||
pub use send_api_request::*;
|
pub use send_api_request::*;
|
||||||
|
use url::Url;
|
||||||
|
|
||||||
use crate::{Error, Result};
|
use crate::{Error, Result};
|
||||||
|
|
||||||
|
@ -69,7 +70,7 @@ impl ImgurClient {
|
||||||
image = BASE64_STANDARD.encode(bytes)
|
image = BASE64_STANDARD.encode(bytes)
|
||||||
}
|
}
|
||||||
// validate url adress
|
// validate url adress
|
||||||
else if !validator::validate_url(path) {
|
else if Url::parse(&path).is_err() {
|
||||||
Err(Error::InvalidUrlOrFile(path.to_string()))?;
|
Err(Error::InvalidUrlOrFile(path.to_string()))?;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue