File tree 1 file changed +8
-4
lines changed
1 file changed +8
-4
lines changed Original file line number Diff line number Diff line change @@ -267,13 +267,17 @@ impl Url {
267
267
/// ```rust
268
268
/// use url::Url;
269
269
///
270
- /// let base = Url::parse("https://example.net/a/b.html").unwrap();
271
- /// let url = base.join("c.png").unwrap();
270
+ /// fn foo() -> Result<(), url::ParseError> {
271
+ /// let base = Url::parse("https://example.net/a/b.html")?;
272
+ /// let url = base.join("c.png")?;
272
273
/// assert_eq!(url.as_str(), "https://example.net/a/c.png"); // Not /a/b.html/c.png
273
274
///
274
- /// let base = Url::parse("https://example.net/a/b/").unwrap() ;
275
- /// let url = base.join("c.png").unwrap() ;
275
+ /// let base = Url::parse("https://example.net/a/b/")? ;
276
+ /// let url = base.join("c.png")? ;
276
277
/// assert_eq!(url.as_str(), "https://example.net/a/b/c.png");
278
+ ///
279
+ /// Ok(())
280
+ /// }
277
281
/// ```
278
282
#[ inline]
279
283
pub fn join ( & self , input : & str ) -> Result < Url , :: ParseError > {
You can’t perform that action at this time.
0 commit comments