Skip to content

Commit 11935ac

Browse files
committed
[WIP] Modify examples to not call unwrap
1 parent 0dfc893 commit 11935ac

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/lib.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -267,12 +267,12 @@ 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+
/// let base = Url::parse("https://example.net/a/b.html")?;
271+
/// let url = base.join("c.png")?;
272272
/// assert_eq!(url.as_str(), "https://example.net/a/c.png"); // Not /a/b.html/c.png
273273
///
274-
/// let base = Url::parse("https://example.net/a/b/").unwrap();
275-
/// let url = base.join("c.png").unwrap();
274+
/// let base = Url::parse("https://example.net/a/b/")?;
275+
/// let url = base.join("c.png")?;
276276
/// assert_eq!(url.as_str(), "https://example.net/a/b/c.png");
277277
/// ```
278278
#[inline]

0 commit comments

Comments
 (0)