mirror of
https://github.com/rust-lang/cargo
synced 2024-08-27 19:29:21 +00:00
reuse url encoding from url
crate, don't use separate percent-encoding
This commit is contained in:
parent
ddfe87fc46
commit
37d429ca67
|
@ -55,7 +55,6 @@ openssl = { version = '0.10.11', optional = true }
|
||||||
os_info = "3.5.0"
|
os_info = "3.5.0"
|
||||||
pasetors = { version = "0.6.4", features = ["v3", "paserk", "std", "serde"] }
|
pasetors = { version = "0.6.4", features = ["v3", "paserk", "std", "serde"] }
|
||||||
pathdiff = "0.2"
|
pathdiff = "0.2"
|
||||||
percent-encoding = "2.0"
|
|
||||||
pretty_env_logger = { version = "0.4", optional = true }
|
pretty_env_logger = { version = "0.4", optional = true }
|
||||||
rustfix = "0.6.0"
|
rustfix = "0.6.0"
|
||||||
semver = { version = "1.0.3", features = ["serde"] }
|
semver = { version = "1.0.3", features = ["serde"] }
|
||||||
|
|
|
@ -15,9 +15,9 @@ use curl::easy::{Easy, InfoType, SslOpt, SslVersion};
|
||||||
use log::{log, Level};
|
use log::{log, Level};
|
||||||
use pasetors::keys::{AsymmetricKeyPair, Generate};
|
use pasetors::keys::{AsymmetricKeyPair, Generate};
|
||||||
use pasetors::paserk::FormatAsPaserk;
|
use pasetors::paserk::FormatAsPaserk;
|
||||||
use percent_encoding::{percent_encode, NON_ALPHANUMERIC};
|
|
||||||
use termcolor::Color::Green;
|
use termcolor::Color::Green;
|
||||||
use termcolor::ColorSpec;
|
use termcolor::ColorSpec;
|
||||||
|
use url::Url;
|
||||||
|
|
||||||
use crate::core::dependency::DepKind;
|
use crate::core::dependency::DepKind;
|
||||||
use crate::core::dependency::Dependency;
|
use crate::core::dependency::Dependency;
|
||||||
|
@ -1201,10 +1201,8 @@ pub fn search(
|
||||||
);
|
);
|
||||||
} else if total_crates > limit && limit >= search_max_limit {
|
} else if total_crates > limit && limit >= search_max_limit {
|
||||||
let extra = if source_ids.original.is_crates_io() {
|
let extra = if source_ids.original.is_crates_io() {
|
||||||
format!(
|
let url = Url::parse_with_params("https://crates.io/search", &[("q", query)])?;
|
||||||
" (go to https://crates.io/search?q={} to see more)",
|
format!(" (go to {url} to see more)")
|
||||||
percent_encode(query.as_bytes(), NON_ALPHANUMERIC)
|
|
||||||
)
|
|
||||||
} else {
|
} else {
|
||||||
String::new()
|
String::new()
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in a new issue