Skip to content

Commit ce37627

Browse files
committed
url: more regressed clippy suppressions
Regressed in 6fd1e87.
1 parent d39870e commit ce37627

File tree

2 files changed

+15
-15
lines changed

2 files changed

+15
-15
lines changed

url/src/lib.rs

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1434,7 +1434,7 @@ impl Url {
14341434
/// Return an object with methods to manipulate this URL’s path segments.
14351435
///
14361436
/// Return `Err(())` if this URL is cannot-be-a-base.
1437-
#[allow(clippy::result_map_unit_fn)]
1437+
#[allow(clippy::result_unit_err)]
14381438
pub fn path_segments_mut(&mut self) -> Result<PathSegmentsMut<'_>, ()> {
14391439
if self.cannot_be_a_base() {
14401440
Err(())
@@ -1518,7 +1518,7 @@ impl Url {
15181518
/// # }
15191519
/// # run().unwrap();
15201520
/// ```
1521-
#[allow(clippy::result_map_unit_fn)]
1521+
#[allow(clippy::result_unit_err)]
15221522
pub fn set_port(&mut self, mut port: Option<u16>) -> Result<(), ()> {
15231523
// has_host implies !cannot_be_a_base
15241524
if !self.has_host() || self.host() == Some(Host::Domain("")) || self.scheme() == "file" {
@@ -1789,7 +1789,7 @@ impl Url {
17891789
/// # run().unwrap();
17901790
/// ```
17911791
///
1792-
#[allow(clippy::result_map_unit_fn)]
1792+
#[allow(clippy::result_unit_err)]
17931793
pub fn set_ip_host(&mut self, address: IpAddr) -> Result<(), ()> {
17941794
if self.cannot_be_a_base() {
17951795
return Err(());
@@ -1829,7 +1829,7 @@ impl Url {
18291829
/// # }
18301830
/// # run().unwrap();
18311831
/// ```
1832-
#[allow(clippy::result_map_unit_fn)]
1832+
#[allow(clippy::result_unit_err)]
18331833
pub fn set_password(&mut self, password: Option<&str>) -> Result<(), ()> {
18341834
// has_host implies !cannot_be_a_base
18351835
if !self.has_host() || self.host() == Some(Host::Domain("")) || self.scheme() == "file" {
@@ -1922,7 +1922,7 @@ impl Url {
19221922
/// # }
19231923
/// # run().unwrap();
19241924
/// ```
1925-
#[allow(clippy::result_map_unit_fn)]
1925+
#[allow(clippy::result_unit_err)]
19261926
pub fn set_username(&mut self, username: &str) -> Result<(), ()> {
19271927
// has_host implies !cannot_be_a_base
19281928
if !self.has_host() || self.host() == Some(Host::Domain("")) || self.scheme() == "file" {
@@ -2084,7 +2084,7 @@ impl Url {
20842084
/// # }
20852085
/// # run().unwrap();
20862086
/// ```
2087-
#[allow(clippy::result_map_unit_fn, clippy::suspicious_operation_groupings)]
2087+
#[allow(clippy::result_unit_err, clippy::suspicious_operation_groupings)]
20882088
pub fn set_scheme(&mut self, scheme: &str) -> Result<(), ()> {
20892089
let mut parser = Parser::for_setter(String::new());
20902090
let remaining = parser.parse_scheme(parser::Input::new(scheme))?;
@@ -2164,7 +2164,7 @@ impl Url {
21642164
/// # }
21652165
/// ```
21662166
#[cfg(any(unix, windows, target_os = "redox"))]
2167-
#[allow(clippy::result_map_unit_fn)]
2167+
#[allow(clippy::result_unit_err)]
21682168
pub fn from_file_path<P: AsRef<Path>>(path: P) -> Result<Url, ()> {
21692169
let mut serialization = "file://".to_owned();
21702170
let host_start = serialization.len() as u32;
@@ -2201,7 +2201,7 @@ impl Url {
22012201
/// Note that `std::path` does not consider trailing slashes significant
22022202
/// and usually does not include them (e.g. in `Path::parent()`).
22032203
#[cfg(any(unix, windows, target_os = "redox"))]
2204-
#[allow(clippy::result_map_unit_fn)]
2204+
#[allow(clippy::result_unit_err)]
22052205
pub fn from_directory_path<P: AsRef<Path>>(path: P) -> Result<Url, ()> {
22062206
let mut url = Url::from_file_path(path)?;
22072207
if !url.serialization.ends_with('/') {
@@ -2318,7 +2318,7 @@ impl Url {
23182318
/// for a Windows path, is not UTF-8.)
23192319
#[inline]
23202320
#[cfg(any(unix, windows, target_os = "redox"))]
2321-
#[allow(clippy::result_map_unit_fn)]
2321+
#[allow(clippy::result_unit_err)]
23222322
pub fn to_file_path(&self) -> Result<PathBuf, ()> {
23232323
if let Some(segments) = self.path_segments() {
23242324
let host = match self.host() {

url/src/quirks.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ pub fn protocol(url: &Url) -> &str {
5656
}
5757

5858
/// Setter for https://url.spec.whatwg.org/#dom-url-protocol
59-
#[allow(clippy::result_map_unit_fn)]
59+
#[allow(clippy::result_unit_err)]
6060
pub fn set_protocol(url: &mut Url, mut new_protocol: &str) -> Result<(), ()> {
6161
// The scheme state in the spec ignores everything after the first `:`,
6262
// but `set_scheme` errors if there is more.
@@ -73,7 +73,7 @@ pub fn username(url: &Url) -> &str {
7373
}
7474

7575
/// Setter for https://url.spec.whatwg.org/#dom-url-username
76-
#[allow(clippy::result_map_unit_fn)]
76+
#[allow(clippy::result_unit_err)]
7777
pub fn set_username(url: &mut Url, new_username: &str) -> Result<(), ()> {
7878
url.set_username(new_username)
7979
}
@@ -85,7 +85,7 @@ pub fn password(url: &Url) -> &str {
8585
}
8686

8787
/// Setter for https://url.spec.whatwg.org/#dom-url-password
88-
#[allow(clippy::result_map_unit_fn)]
88+
#[allow(clippy::result_unit_err)]
8989
pub fn set_password(url: &mut Url, new_password: &str) -> Result<(), ()> {
9090
url.set_password(if new_password.is_empty() {
9191
None
@@ -101,7 +101,7 @@ pub fn host(url: &Url) -> &str {
101101
}
102102

103103
/// Setter for https://url.spec.whatwg.org/#dom-url-host
104-
#[allow(clippy::result_map_unit_fn)]
104+
#[allow(clippy::result_unit_err)]
105105
pub fn set_host(url: &mut Url, new_host: &str) -> Result<(), ()> {
106106
// If context object’s url’s cannot-be-a-base-URL flag is set, then return.
107107
if url.cannot_be_a_base() {
@@ -158,7 +158,7 @@ pub fn hostname(url: &Url) -> &str {
158158
}
159159

160160
/// Setter for https://url.spec.whatwg.org/#dom-url-hostname
161-
#[allow(clippy::result_map_unit_fn)]
161+
#[allow(clippy::result_unit_err)]
162162
pub fn set_hostname(url: &mut Url, new_hostname: &str) -> Result<(), ()> {
163163
if url.cannot_be_a_base() {
164164
return Err(());
@@ -200,7 +200,7 @@ pub fn port(url: &Url) -> &str {
200200
}
201201

202202
/// Setter for https://url.spec.whatwg.org/#dom-url-port
203-
#[allow(clippy::result_map_unit_fn)]
203+
#[allow(clippy::result_unit_err)]
204204
pub fn set_port(url: &mut Url, new_port: &str) -> Result<(), ()> {
205205
let result;
206206
{

0 commit comments

Comments
 (0)