Skip to content

Commit 224ac40

Browse files
committed
Ignore clippy::result-unit-err lint as it would require API changes
1 parent 21aed6e commit 224ac40

File tree

2 files changed

+15
-0
lines changed

2 files changed

+15
-0
lines changed

url/src/lib.rs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1433,6 +1433,7 @@ impl Url {
14331433
/// Return an object with methods to manipulate this URL’s path segments.
14341434
///
14351435
/// Return `Err(())` if this URL is cannot-be-a-base.
1436+
#[allow(clippy::clippy::result_unit_err)]
14361437
pub fn path_segments_mut(&mut self) -> Result<PathSegmentsMut<'_>, ()> {
14371438
if self.cannot_be_a_base() {
14381439
Err(())
@@ -1516,6 +1517,7 @@ impl Url {
15161517
/// # }
15171518
/// # run().unwrap();
15181519
/// ```
1520+
#[allow(clippy::clippy::result_unit_err)]
15191521
pub fn set_port(&mut self, mut port: Option<u16>) -> Result<(), ()> {
15201522
// has_host implies !cannot_be_a_base
15211523
if !self.has_host() || self.host() == Some(Host::Domain("")) || self.scheme() == "file" {
@@ -1786,6 +1788,7 @@ impl Url {
17861788
/// # run().unwrap();
17871789
/// ```
17881790
///
1791+
#[allow(clippy::clippy::result_unit_err)]
17891792
pub fn set_ip_host(&mut self, address: IpAddr) -> Result<(), ()> {
17901793
if self.cannot_be_a_base() {
17911794
return Err(());
@@ -1825,6 +1828,7 @@ impl Url {
18251828
/// # }
18261829
/// # run().unwrap();
18271830
/// ```
1831+
#[allow(clippy::clippy::result_unit_err)]
18281832
pub fn set_password(&mut self, password: Option<&str>) -> Result<(), ()> {
18291833
// has_host implies !cannot_be_a_base
18301834
if !self.has_host() || self.host() == Some(Host::Domain("")) || self.scheme() == "file" {
@@ -1917,6 +1921,7 @@ impl Url {
19171921
/// # }
19181922
/// # run().unwrap();
19191923
/// ```
1924+
#[allow(clippy::clippy::result_unit_err)]
19201925
pub fn set_username(&mut self, username: &str) -> Result<(), ()> {
19211926
// has_host implies !cannot_be_a_base
19221927
if !self.has_host() || self.host() == Some(Host::Domain("")) || self.scheme() == "file" {
@@ -2078,6 +2083,7 @@ impl Url {
20782083
/// # }
20792084
/// # run().unwrap();
20802085
/// ```
2086+
#[allow(clippy::clippy::result_unit_err)]
20812087
pub fn set_scheme(&mut self, scheme: &str) -> Result<(), ()> {
20822088
let mut parser = Parser::for_setter(String::new());
20832089
let remaining = parser.parse_scheme(parser::Input::new(scheme))?;
@@ -2157,6 +2163,7 @@ impl Url {
21572163
/// # }
21582164
/// ```
21592165
#[cfg(any(unix, windows, target_os = "redox"))]
2166+
#[allow(clippy::clippy::result_unit_err)]
21602167
pub fn from_file_path<P: AsRef<Path>>(path: P) -> Result<Url, ()> {
21612168
let mut serialization = "file://".to_owned();
21622169
let host_start = serialization.len() as u32;
@@ -2193,6 +2200,7 @@ impl Url {
21932200
/// Note that `std::path` does not consider trailing slashes significant
21942201
/// and usually does not include them (e.g. in `Path::parent()`).
21952202
#[cfg(any(unix, windows, target_os = "redox"))]
2203+
#[allow(clippy::clippy::result_unit_err)]
21962204
pub fn from_directory_path<P: AsRef<Path>>(path: P) -> Result<Url, ()> {
21972205
let mut url = Url::from_file_path(path)?;
21982206
if !url.serialization.ends_with('/') {
@@ -2309,6 +2317,7 @@ impl Url {
23092317
/// for a Windows path, is not UTF-8.)
23102318
#[inline]
23112319
#[cfg(any(unix, windows, target_os = "redox"))]
2320+
#[allow(clippy::clippy::result_unit_err)]
23122321
pub fn to_file_path(&self) -> Result<PathBuf, ()> {
23132322
if let Some(segments) = self.path_segments() {
23142323
let host = match self.host() {

url/src/quirks.rs

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

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

7475
/// Setter for https://url.spec.whatwg.org/#dom-url-username
76+
#[allow(clippy::clippy::result_unit_err)]
7577
pub fn set_username(url: &mut Url, new_username: &str) -> Result<(), ()> {
7678
url.set_username(new_username)
7779
}
@@ -83,6 +85,7 @@ pub fn password(url: &Url) -> &str {
8385
}
8486

8587
/// Setter for https://url.spec.whatwg.org/#dom-url-password
88+
#[allow(clippy::clippy::result_unit_err)]
8689
pub fn set_password(url: &mut Url, new_password: &str) -> Result<(), ()> {
8790
url.set_password(if new_password.is_empty() {
8891
None
@@ -98,6 +101,7 @@ pub fn host(url: &Url) -> &str {
98101
}
99102

100103
/// Setter for https://url.spec.whatwg.org/#dom-url-host
104+
#[allow(clippy::clippy::result_unit_err)]
101105
pub fn set_host(url: &mut Url, new_host: &str) -> Result<(), ()> {
102106
// If context object’s url’s cannot-be-a-base-URL flag is set, then return.
103107
if url.cannot_be_a_base() {
@@ -154,6 +158,7 @@ pub fn hostname(url: &Url) -> &str {
154158
}
155159

156160
/// Setter for https://url.spec.whatwg.org/#dom-url-hostname
161+
#[allow(clippy::clippy::result_unit_err)]
157162
pub fn set_hostname(url: &mut Url, new_hostname: &str) -> Result<(), ()> {
158163
if url.cannot_be_a_base() {
159164
return Err(());
@@ -195,6 +200,7 @@ pub fn port(url: &Url) -> &str {
195200
}
196201

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

0 commit comments

Comments
 (0)