Skip to content

Commit ac9600b

Browse files
d3lmanonrig
authored andcommitted
fixup: code review
1 parent 7778f3e commit ac9600b

File tree

2 files changed

+12
-12
lines changed

2 files changed

+12
-12
lines changed

src/ffi.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ extern "C" {
8383
pub fn ada_get_search(url: *mut ada_url) -> ada_string;
8484
pub fn ada_get_protocol(url: *mut ada_url) -> ada_string;
8585
pub fn ada_get_host_type(url: *mut ada_url) -> c_uint;
86-
pub fn ada_get_schema_type(url: *mut ada_url) -> c_uint;
86+
pub fn ada_get_scheme_type(url: *mut ada_url) -> c_uint;
8787

8888
// Setters
8989
pub fn ada_set_href(url: *mut ada_url, input: *const c_char, length: usize) -> bool;

src/lib.rs

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -252,8 +252,8 @@ impl Url {
252252
}
253253

254254
/// Returns the type of the scheme such as http, https, etc.
255-
pub fn scheme(&self) -> SchemeType {
256-
SchemeType::from(unsafe { ffi::ada_get_schema_type(self.0) })
255+
pub fn scheme_type(&self) -> SchemeType {
256+
SchemeType::from(unsafe { ffi::ada_get_scheme_type(self.0) })
257257
}
258258

259259
/// Return the origin of this URL
@@ -939,7 +939,7 @@ mod test {
939939
"https://username:[email protected]:9090/search?query#hash"
940940
);
941941

942-
assert_eq!(out.scheme(), SchemeType::Https);
942+
assert_eq!(out.scheme_type(), SchemeType::Https);
943943

944944
out.set_username(Some("new-username")).unwrap();
945945
assert_eq!(out.username(), "new-username");
@@ -971,7 +971,7 @@ mod test {
971971

972972
out.set_protocol("wss").unwrap();
973973
assert_eq!(out.protocol(), "wss:");
974-
assert_eq!(out.scheme(), SchemeType::Wss);
974+
assert_eq!(out.scheme_type(), SchemeType::Wss);
975975

976976
assert!(out.has_credentials());
977977
assert!(out.has_non_empty_username());
@@ -988,43 +988,43 @@ mod test {
988988
assert_eq!(
989989
Url::parse("file:///foo/bar", None)
990990
.expect("bad url")
991-
.scheme(),
991+
.scheme_type(),
992992
SchemeType::File
993993
);
994994
assert_eq!(
995995
Url::parse("ws://example.com/ws", None)
996996
.expect("bad url")
997-
.scheme(),
997+
.scheme_type(),
998998
SchemeType::Ws
999999
);
10001000
assert_eq!(
10011001
Url::parse("wss://example.com/wss", None)
10021002
.expect("bad url")
1003-
.scheme(),
1003+
.scheme_type(),
10041004
SchemeType::Wss
10051005
);
10061006
assert_eq!(
10071007
Url::parse("ftp://example.com/file.txt", None)
10081008
.expect("bad url")
1009-
.scheme(),
1009+
.scheme_type(),
10101010
SchemeType::Ftp
10111011
);
10121012
assert_eq!(
10131013
Url::parse("http://example.com/file.txt", None)
10141014
.expect("bad url")
1015-
.scheme(),
1015+
.scheme_type(),
10161016
SchemeType::Http
10171017
);
10181018
assert_eq!(
10191019
Url::parse("https://example.com/file.txt", None)
10201020
.expect("bad url")
1021-
.scheme(),
1021+
.scheme_type(),
10221022
SchemeType::Https
10231023
);
10241024
assert_eq!(
10251025
Url::parse("foo://example.com", None)
10261026
.expect("bad url")
1027-
.scheme(),
1027+
.scheme_type(),
10281028
SchemeType::NotSpecial
10291029
);
10301030
}

0 commit comments

Comments
 (0)