Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a few doc examples. #228

Merged
merged 3 commits into from Nov 1, 2016
Merged
Changes from 1 commit
Commits
File filter...
Filter file types
Jump to…
Jump to file
Failed to load files.

Always

Just for now

Next

Add doc example for url::Url::port.

  • Loading branch information
frewsxcv committed Sep 30, 2016
commit f032633a7b248afca431cadf0715dbe35d3cd069
@@ -560,6 +560,18 @@ impl Url {
}

/// Return the port number for this URL, if any.
///
/// # Examples
///
/// ```
/// use url::Url;
///
/// let url = Url::parse("https://example.com").unwrap();
/// assert_eq!(url.port(), None);
///
/// let url = Url::parse("ssh://example.com:22").unwrap();
/// assert_eq!(url.port(), Some(22));
/// ```
#[inline]
pub fn port(&self) -> Option<u16> {
self.port
ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.