Skip to content

Commit 8983fd9

Browse files
author
bors-servo
authored
Auto merge of #379 - rap2hpoutre:master, r=SimonSapin
Add error documentation on parse function See: #314 This is just a try, feel free to close or comment if it's not good. I just submit one error documentation because I want to clearly understand what's the pattern before submitting more documentation: I still have to learn, so I prefer just trying on one function for now (but I can help after that) <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/rust-url/379) <!-- Reviewable:end -->
2 parents 5caf4a8 + b8e1a95 commit 8983fd9

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/lib.rs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -252,6 +252,13 @@ impl Url {
252252
/// # }
253253
/// # run().unwrap();
254254
/// ```
255+
///
256+
/// # Errors
257+
///
258+
/// If the function can not parse an absolute URL from the given string,
259+
/// a [`ParseError`] variant will be returned.
260+
///
261+
/// [`ParseError`]: enum.ParseError.html
255262
#[inline]
256263
pub fn parse(input: &str) -> Result<Url, ::ParseError> {
257264
Url::options().parse(input)

0 commit comments

Comments
 (0)