Browse Source

Add another `url::Url::username` doc example.

Corey Farwell 10 years ago
parent
commit
80c0c4889e
1 changed files with 3 additions and 0 deletions
  1. 3 0
      src/lib.rs

+ 3 - 0
src/lib.rs

@@ -460,6 +460,9 @@ impl Url {
     /// let url = Url::parse("ftp://rms@example.com").unwrap();
     /// assert_eq!(url.username(), "rms");
     ///
+    /// let url = Url::parse("ftp://:secret123@example.com").unwrap();
+    /// assert_eq!(url.username(), "");
+    ///
     /// let url = Url::parse("https://example.com").unwrap();
     /// assert_eq!(url.username(), "");
     /// ```