@@ -252,8 +252,8 @@ impl Url {
252
252
}
253
253
254
254
/// 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 ) } )
257
257
}
258
258
259
259
/// Return the origin of this URL
@@ -939,7 +939,7 @@ mod test {
939
939
"https://username:[email protected] :9090/search?query#hash"
940
940
) ;
941
941
942
- assert_eq ! ( out. scheme ( ) , SchemeType :: Https ) ;
942
+ assert_eq ! ( out. scheme_type ( ) , SchemeType :: Https ) ;
943
943
944
944
out. set_username ( Some ( "new-username" ) ) . unwrap ( ) ;
945
945
assert_eq ! ( out. username( ) , "new-username" ) ;
@@ -971,7 +971,7 @@ mod test {
971
971
972
972
out. set_protocol ( "wss" ) . unwrap ( ) ;
973
973
assert_eq ! ( out. protocol( ) , "wss:" ) ;
974
- assert_eq ! ( out. scheme ( ) , SchemeType :: Wss ) ;
974
+ assert_eq ! ( out. scheme_type ( ) , SchemeType :: Wss ) ;
975
975
976
976
assert ! ( out. has_credentials( ) ) ;
977
977
assert ! ( out. has_non_empty_username( ) ) ;
@@ -988,43 +988,43 @@ mod test {
988
988
assert_eq ! (
989
989
Url :: parse( "file:///foo/bar" , None )
990
990
. expect( "bad url" )
991
- . scheme ( ) ,
991
+ . scheme_type ( ) ,
992
992
SchemeType :: File
993
993
) ;
994
994
assert_eq ! (
995
995
Url :: parse( "ws://example.com/ws" , None )
996
996
. expect( "bad url" )
997
- . scheme ( ) ,
997
+ . scheme_type ( ) ,
998
998
SchemeType :: Ws
999
999
) ;
1000
1000
assert_eq ! (
1001
1001
Url :: parse( "wss://example.com/wss" , None )
1002
1002
. expect( "bad url" )
1003
- . scheme ( ) ,
1003
+ . scheme_type ( ) ,
1004
1004
SchemeType :: Wss
1005
1005
) ;
1006
1006
assert_eq ! (
1007
1007
Url :: parse( "ftp://example.com/file.txt" , None )
1008
1008
. expect( "bad url" )
1009
- . scheme ( ) ,
1009
+ . scheme_type ( ) ,
1010
1010
SchemeType :: Ftp
1011
1011
) ;
1012
1012
assert_eq ! (
1013
1013
Url :: parse( "http://example.com/file.txt" , None )
1014
1014
. expect( "bad url" )
1015
- . scheme ( ) ,
1015
+ . scheme_type ( ) ,
1016
1016
SchemeType :: Http
1017
1017
) ;
1018
1018
assert_eq ! (
1019
1019
Url :: parse( "https://example.com/file.txt" , None )
1020
1020
. expect( "bad url" )
1021
- . scheme ( ) ,
1021
+ . scheme_type ( ) ,
1022
1022
SchemeType :: Https
1023
1023
) ;
1024
1024
assert_eq ! (
1025
1025
Url :: parse( "foo://example.com" , None )
1026
1026
. expect( "bad url" )
1027
- . scheme ( ) ,
1027
+ . scheme_type ( ) ,
1028
1028
SchemeType :: NotSpecial
1029
1029
) ;
1030
1030
}
0 commit comments