aboutsummaryrefslogtreecommitdiff
path: root/src/lib.rs
diff options
context:
space:
mode:
authorRichard Walters <rwalters@digitalstirling.com>2020-10-13 16:49:29 -0700
committerRichard Walters <rwalters@digitalstirling.com>2020-10-13 16:49:29 -0700
commit1aad71d0f34638864748eb3ecdc55daf48ab5ecd (patch)
treeff5a00e2349732fb67a64d519887185315fdb2c1 /src/lib.rs
parenta7e33fedada38f4454483eebb506633afde6be5e (diff)
Fix issue with naming
Use "to_" prefix instead of "as_" for functions which create values (expensive). See: https://rust-lang.github.io/api-guidelines/naming.html#ad-hoc-conversions-follow-as_-to_-into_-conventions-c-conv
Diffstat (limited to 'src/lib.rs')
-rw-r--r--src/lib.rs8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/lib.rs b/src/lib.rs
index d4afe6a..9681872 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -28,10 +28,10 @@
//! let uri = Uri::parse("http://www.example.com/foo?bar#baz").unwrap();
//! let authority = uri.authority().unwrap();
//! assert_eq!("www.example.com".as_bytes(), authority.host());
-//! assert_eq!(Some("www.example.com"), uri.host_as_string().unwrap().as_deref());
-//! assert_eq!("/foo", uri.path_as_string().unwrap());
-//! assert_eq!(Some("bar"), uri.query_as_string().unwrap().as_deref());
-//! assert_eq!(Some("baz"), uri.fragment_as_string().unwrap().as_deref());
+//! assert_eq!(Some("www.example.com"), uri.host_to_string().unwrap().as_deref());
+//! assert_eq!("/foo", uri.path_to_string().unwrap());
+//! assert_eq!(Some("bar"), uri.query_to_string().unwrap().as_deref());
+//! assert_eq!(Some("baz"), uri.fragment_to_string().unwrap().as_deref());
//! ```
//!
//! ## Generating a URI from its components