Skip to content

Commit a3785bc

Browse files
cryptoquicklucacasonato
authored andcommitted
Use automatic links to resolve the cargo doc warning, "this URL is not a hyperlink".
1 parent 2de57d4 commit a3785bc

File tree

2 files changed

+29
-29
lines changed

2 files changed

+29
-29
lines changed

idna/src/uts46.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -475,7 +475,7 @@ impl Idna {
475475
errors
476476
}
477477

478-
/// http://www.unicode.org/reports/tr46/#ToASCII
478+
/// <http://www.unicode.org/reports/tr46/#ToASCII>
479479
#[allow(clippy::wrong_self_convention)]
480480
pub fn to_ascii(&mut self, domain: &str, out: &mut String) -> Result<(), Errors> {
481481
let mut errors = self.to_ascii_inner(domain, out);
@@ -497,7 +497,7 @@ impl Idna {
497497
errors.into()
498498
}
499499

500-
/// http://www.unicode.org/reports/tr46/#ToUnicode
500+
/// <http://www.unicode.org/reports/tr46/#ToUnicode>
501501
#[allow(clippy::wrong_self_convention)]
502502
pub fn to_unicode(&mut self, domain: &str, out: &mut String) -> Result<(), Errors> {
503503
if is_simple(domain) {
@@ -517,7 +517,7 @@ pub struct Config {
517517
use_idna_2008_rules: bool,
518518
}
519519

520-
/// The defaults are that of https://url.spec.whatwg.org/#idna
520+
/// The defaults are that of <https://url.spec.whatwg.org/#idna>
521521
impl Default for Config {
522522
fn default() -> Self {
523523
Config {
@@ -565,14 +565,14 @@ impl Config {
565565
self
566566
}
567567

568-
/// http://www.unicode.org/reports/tr46/#ToASCII
568+
/// <http://www.unicode.org/reports/tr46/#ToASCII>
569569
pub fn to_ascii(self, domain: &str) -> Result<String, Errors> {
570570
let mut result = String::with_capacity(domain.len());
571571
let mut codec = Idna::new(self);
572572
codec.to_ascii(domain, &mut result).map(|()| result)
573573
}
574574

575-
/// http://www.unicode.org/reports/tr46/#ToUnicode
575+
/// <http://www.unicode.org/reports/tr46/#ToUnicode>
576576
pub fn to_unicode(self, domain: &str) -> (String, Result<(), Errors>) {
577577
let mut codec = Idna::new(self);
578578
let mut out = String::with_capacity(domain.len());

url/src/quirks.rs

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
// option. This file may not be copied, modified, or distributed
77
// except according to those terms.
88

9-
//! Getters and setters for URL components implemented per https://url.spec.whatwg.org/#api
9+
//! Getters and setters for URL components implemented per <https://url.spec.whatwg.org/#api>
1010
//!
1111
//! Unless you need to be interoperable with web browsers,
1212
//! you probably want to use `Url` method instead.
@@ -57,15 +57,15 @@ pub fn internal_components(url: &Url) -> InternalComponents {
5757
}
5858
}
5959

60-
/// https://url.spec.whatwg.org/#dom-url-domaintoascii
60+
/// <https://url.spec.whatwg.org/#dom-url-domaintoascii>
6161
pub fn domain_to_ascii(domain: &str) -> String {
6262
match Host::parse(domain) {
6363
Ok(Host::Domain(domain)) => domain,
6464
_ => String::new(),
6565
}
6666
}
6767

68-
/// https://url.spec.whatwg.org/#dom-url-domaintounicode
68+
/// <https://url.spec.whatwg.org/#dom-url-domaintounicode>
6969
pub fn domain_to_unicode(domain: &str) -> String {
7070
match Host::parse(domain) {
7171
Ok(Host::Domain(ref domain)) => {
@@ -76,29 +76,29 @@ pub fn domain_to_unicode(domain: &str) -> String {
7676
}
7777
}
7878

79-
/// Getter for https://url.spec.whatwg.org/#dom-url-href
79+
/// Getter for <https://url.spec.whatwg.org/#dom-url-href>
8080
pub fn href(url: &Url) -> &str {
8181
url.as_str()
8282
}
8383

84-
/// Setter for https://url.spec.whatwg.org/#dom-url-href
84+
/// Setter for <https://url.spec.whatwg.org/#dom-url-href>
8585
pub fn set_href(url: &mut Url, value: &str) -> Result<(), ParseError> {
8686
*url = Url::parse(value)?;
8787
Ok(())
8888
}
8989

90-
/// Getter for https://url.spec.whatwg.org/#dom-url-origin
90+
/// Getter for <https://url.spec.whatwg.org/#dom-url-origin>
9191
pub fn origin(url: &Url) -> String {
9292
url.origin().ascii_serialization()
9393
}
9494

95-
/// Getter for https://url.spec.whatwg.org/#dom-url-protocol
95+
/// Getter for <https://url.spec.whatwg.org/#dom-url-protocol>
9696
#[inline]
9797
pub fn protocol(url: &Url) -> &str {
9898
&url.as_str()[..url.scheme().len() + ":".len()]
9999
}
100100

101-
/// Setter for https://url.spec.whatwg.org/#dom-url-protocol
101+
/// Setter for <https://url.spec.whatwg.org/#dom-url-protocol>
102102
#[allow(clippy::result_unit_err)]
103103
pub fn set_protocol(url: &mut Url, mut new_protocol: &str) -> Result<(), ()> {
104104
// The scheme state in the spec ignores everything after the first `:`,
@@ -109,25 +109,25 @@ pub fn set_protocol(url: &mut Url, mut new_protocol: &str) -> Result<(), ()> {
109109
url.set_scheme(new_protocol)
110110
}
111111

112-
/// Getter for https://url.spec.whatwg.org/#dom-url-username
112+
/// Getter for <https://url.spec.whatwg.org/#dom-url-username>
113113
#[inline]
114114
pub fn username(url: &Url) -> &str {
115115
url.username()
116116
}
117117

118-
/// Setter for https://url.spec.whatwg.org/#dom-url-username
118+
/// Setter for <https://url.spec.whatwg.org/#dom-url-username>
119119
#[allow(clippy::result_unit_err)]
120120
pub fn set_username(url: &mut Url, new_username: &str) -> Result<(), ()> {
121121
url.set_username(new_username)
122122
}
123123

124-
/// Getter for https://url.spec.whatwg.org/#dom-url-password
124+
/// Getter for <https://url.spec.whatwg.org/#dom-url-password>
125125
#[inline]
126126
pub fn password(url: &Url) -> &str {
127127
url.password().unwrap_or("")
128128
}
129129

130-
/// Setter for https://url.spec.whatwg.org/#dom-url-password
130+
/// Setter for <https://url.spec.whatwg.org/#dom-url-password>
131131
#[allow(clippy::result_unit_err)]
132132
pub fn set_password(url: &mut Url, new_password: &str) -> Result<(), ()> {
133133
url.set_password(if new_password.is_empty() {
@@ -137,13 +137,13 @@ pub fn set_password(url: &mut Url, new_password: &str) -> Result<(), ()> {
137137
})
138138
}
139139

140-
/// Getter for https://url.spec.whatwg.org/#dom-url-host
140+
/// Getter for <https://url.spec.whatwg.org/#dom-url-host>
141141
#[inline]
142142
pub fn host(url: &Url) -> &str {
143143
&url[Position::BeforeHost..Position::AfterPort]
144144
}
145145

146-
/// Setter for https://url.spec.whatwg.org/#dom-url-host
146+
/// Setter for <https://url.spec.whatwg.org/#dom-url-host>
147147
#[allow(clippy::result_unit_err)]
148148
pub fn set_host(url: &mut Url, new_host: &str) -> Result<(), ()> {
149149
// If context object’s url’s cannot-be-a-base-URL flag is set, then return.
@@ -190,13 +190,13 @@ pub fn set_host(url: &mut Url, new_host: &str) -> Result<(), ()> {
190190
Ok(())
191191
}
192192

193-
/// Getter for https://url.spec.whatwg.org/#dom-url-hostname
193+
/// Getter for <https://url.spec.whatwg.org/#dom-url-hostname>
194194
#[inline]
195195
pub fn hostname(url: &Url) -> &str {
196196
url.host_str().unwrap_or("")
197197
}
198198

199-
/// Setter for https://url.spec.whatwg.org/#dom-url-hostname
199+
/// Setter for <https://url.spec.whatwg.org/#dom-url-hostname>
200200
#[allow(clippy::result_unit_err)]
201201
pub fn set_hostname(url: &mut Url, new_hostname: &str) -> Result<(), ()> {
202202
if url.cannot_be_a_base() {
@@ -232,13 +232,13 @@ pub fn set_hostname(url: &mut Url, new_hostname: &str) -> Result<(), ()> {
232232
}
233233
}
234234

235-
/// Getter for https://url.spec.whatwg.org/#dom-url-port
235+
/// Getter for <https://url.spec.whatwg.org/#dom-url-port>
236236
#[inline]
237237
pub fn port(url: &Url) -> &str {
238238
&url[Position::BeforePort..Position::AfterPort]
239239
}
240240

241-
/// Setter for https://url.spec.whatwg.org/#dom-url-port
241+
/// Setter for <https://url.spec.whatwg.org/#dom-url-port>
242242
#[allow(clippy::result_unit_err)]
243243
pub fn set_port(url: &mut Url, new_port: &str) -> Result<(), ()> {
244244
let result;
@@ -262,13 +262,13 @@ pub fn set_port(url: &mut Url, new_port: &str) -> Result<(), ()> {
262262
}
263263
}
264264

265-
/// Getter for https://url.spec.whatwg.org/#dom-url-pathname
265+
/// Getter for <https://url.spec.whatwg.org/#dom-url-pathname>
266266
#[inline]
267267
pub fn pathname(url: &Url) -> &str {
268268
url.path()
269269
}
270270

271-
/// Setter for https://url.spec.whatwg.org/#dom-url-pathname
271+
/// Setter for <https://url.spec.whatwg.org/#dom-url-pathname>
272272
pub fn set_pathname(url: &mut Url, new_pathname: &str) {
273273
if url.cannot_be_a_base() {
274274
return;
@@ -286,12 +286,12 @@ pub fn set_pathname(url: &mut Url, new_pathname: &str) {
286286
}
287287
}
288288

289-
/// Getter for https://url.spec.whatwg.org/#dom-url-search
289+
/// Getter for <https://url.spec.whatwg.org/#dom-url-search>
290290
pub fn search(url: &Url) -> &str {
291291
trim(&url[Position::AfterPath..Position::AfterQuery])
292292
}
293293

294-
/// Setter for https://url.spec.whatwg.org/#dom-url-search
294+
/// Setter for <https://url.spec.whatwg.org/#dom-url-search>
295295
pub fn set_search(url: &mut Url, new_search: &str) {
296296
url.set_query(match new_search {
297297
"" => None,
@@ -300,12 +300,12 @@ pub fn set_search(url: &mut Url, new_search: &str) {
300300
})
301301
}
302302

303-
/// Getter for https://url.spec.whatwg.org/#dom-url-hash
303+
/// Getter for <https://url.spec.whatwg.org/#dom-url-hash>
304304
pub fn hash(url: &Url) -> &str {
305305
trim(&url[Position::AfterQuery..])
306306
}
307307

308-
/// Setter for https://url.spec.whatwg.org/#dom-url-hash
308+
/// Setter for <https://url.spec.whatwg.org/#dom-url-hash>
309309
pub fn set_hash(url: &mut Url, new_hash: &str) {
310310
url.set_fragment(match new_hash {
311311
// If the given value is the empty string,

0 commit comments

Comments
 (0)