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. #239

Merged
merged 4 commits into from Nov 14, 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

Add doc example for `url::Url::as_str`.

  • Loading branch information
frewsxcv committed Nov 14, 2016
commit b58ebab2de5460e138286f876fde803ebc39a5cb
@@ -271,6 +271,16 @@ impl Url {
/// Return the serialization of this URL.
///
/// This is fast since that serialization is already stored in the `Url` struct.
///
/// # Examples
///
/// ```rust
/// use url::Url;
///
/// let url_str = "https://example.net/";
/// let url = Url::parse(url_str).unwrap();
/// assert_eq!(url.as_str(), url_str);
/// ```
#[inline]
pub fn as_str(&self) -> &str {
&self.serialization
ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.