@@ -281,6 +281,13 @@ impl Url {
281
281
/// # }
282
282
/// # run().unwrap();
283
283
/// ```
284
+ ///
285
+ /// # Errors
286
+ ///
287
+ /// If the function can not parse an absolute URL from the given string,
288
+ /// a [`ParseError`] variant will be returned.
289
+ ///
290
+ /// [`ParseError`]: enum.ParseError.html
284
291
#[ inline]
285
292
pub fn parse_with_params < I , K , V > ( input : & str , iter : I ) -> Result < Url , :: ParseError >
286
293
where I : IntoIterator ,
@@ -321,6 +328,13 @@ impl Url {
321
328
/// # }
322
329
/// # run().unwrap();
323
330
/// ```
331
+ ///
332
+ /// # Errors
333
+ ///
334
+ /// If the function can not parse an URL from the given string
335
+ /// with this URL as the base URL, a [`ParseError`] variant will be returned.
336
+ ///
337
+ /// [`ParseError`]: enum.ParseError.html
324
338
#[ inline]
325
339
pub fn join ( & self , input : & str ) -> Result < Url , :: ParseError > {
326
340
Url :: options ( ) . base_url ( Some ( self ) ) . parse ( input)
@@ -1455,9 +1469,6 @@ impl Url {
1455
1469
1456
1470
/// Change this URL’s host.
1457
1471
///
1458
- /// If this URL is cannot-be-a-base or there is an error parsing the given `host`,
1459
- /// do nothing and return `Err`.
1460
- ///
1461
1472
/// Removing the host (calling this with `None`)
1462
1473
/// will also remove any username, password, and port number.
1463
1474
///
@@ -1531,6 +1542,13 @@ impl Url {
1531
1542
/// # }
1532
1543
/// # run().unwrap();
1533
1544
/// ```
1545
+ ///
1546
+ /// # Errors
1547
+ ///
1548
+ /// If this URL is cannot-be-a-base or there is an error parsing the given `host`,
1549
+ /// a [`ParseError`] variant will be returned.
1550
+ ///
1551
+ /// [`ParseError`]: enum.ParseError.html
1534
1552
pub fn set_host ( & mut self , host : Option < & str > ) -> Result < ( ) , ParseError > {
1535
1553
if self . cannot_be_a_base ( ) {
1536
1554
return Err ( ParseError :: SetHostOnCannotBeABaseUrl )
0 commit comments