Эх сурвалжийг харах

Auto merge of #379 - rap2hpoutre:master, r=SimonSapin

Add error documentation on parse function

See: https://github.com/servo/rust-url/issues/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 -->
bors-servo 9 жил өмнө
parent
commit
8983fd98b0
1 өөрчлөгдсөн 7 нэмэгдсэн , 0 устгасан
  1. 7 0
      src/lib.rs

+ 7 - 0
src/lib.rs

@@ -252,6 +252,13 @@ impl Url {
     /// # }
     /// # run().unwrap();
     /// ```
+    /// 
+    /// # Errors
+    ///
+    /// If the function can not parse an absolute URL from the given string,
+    /// a [`ParseError`] variant will be returned.
+    ///
+    /// [`ParseError`]: enum.ParseError.html
     #[inline]
     pub fn parse(input: &str) -> Result<Url, ::ParseError> {
         Url::options().parse(input)