File tree Expand file tree Collapse file tree 1 file changed +8
-4
lines changed Expand file tree Collapse file tree 1 file changed +8
-4
lines changed Original file line number Diff line number Diff line change @@ -267,13 +267,17 @@ impl Url {
267267 /// ```rust
268268 /// use url::Url;
269269 ///
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")?;
272273 /// assert_eq!(url.as_str(), "https://example.net/a/c.png"); // Not /a/b.html/c.png
273274 ///
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")? ;
276277 /// assert_eq!(url.as_str(), "https://example.net/a/b/c.png");
278+ ///
279+ /// Ok(())
280+ /// }
277281 /// ```
278282 #[ inline]
279283 pub fn join ( & self , input : & str ) -> Result < Url , :: ParseError > {
You can’t perform that action at this time.
0 commit comments