@@ -18,11 +18,11 @@ quick_error! {
1818 from( )
1919 source( & * * err)
2020 }
21- UnsupportedUrlTokens ( url: bstr:: BString , scheme: git_url:: Protocol ) {
21+ UnsupportedUrlTokens ( url: bstr:: BString , scheme: git_url:: Scheme ) {
2222 display( "The url '{}' contains information that would not be used by the '{}' protocol" , url, scheme)
2323 }
2424 #[ cfg( not( feature = "http-client-curl" ) ) ]
25- CompiledWithoutHttp ( scheme: git_url:: Protocol ) {
25+ CompiledWithoutHttp ( scheme: git_url:: Scheme ) {
2626 display( "'{}' is not compiled in. Compile with the 'http' cargo feature" , scheme)
2727 }
2828 }
@@ -32,17 +32,17 @@ quick_error! {
3232pub fn connect ( url : & [ u8 ] , version : crate :: Protocol ) -> Result < Box < dyn Transport > , Error > {
3333 let urlb = url;
3434 let url = git_url:: parse ( urlb) ?;
35- Ok ( match url. protocol {
36- git_url:: Protocol :: File => {
35+ Ok ( match url. scheme {
36+ git_url:: Scheme :: File => {
3737 if url. user . is_some ( ) || url. host . is_some ( ) || url. port . is_some ( ) {
38- return Err ( Error :: UnsupportedUrlTokens ( urlb. into ( ) , url. protocol ) ) ;
38+ return Err ( Error :: UnsupportedUrlTokens ( urlb. into ( ) , url. scheme ) ) ;
3939 }
4040 Box :: new (
4141 crate :: client:: file:: connect ( url. path )
4242 . map_err ( |e| Box :: new ( e) as Box < dyn std:: error:: Error + Send + Sync > ) ?,
4343 )
4444 }
45- git_url:: Protocol :: Ssh => Box :: new (
45+ git_url:: Scheme :: Ssh => Box :: new (
4646 crate :: client:: ssh:: connect (
4747 & url. host . as_ref ( ) . expect ( "host is present in url" ) ,
4848 url. path ,
@@ -52,9 +52,9 @@ pub fn connect(url: &[u8], version: crate::Protocol) -> Result<Box<dyn Transport
5252 )
5353 . map_err ( |e| Box :: new ( e) as Box < dyn std:: error:: Error + Send + Sync > ) ?,
5454 ) ,
55- git_url:: Protocol :: Git => {
55+ git_url:: Scheme :: Git => {
5656 if url. user . is_some ( ) {
57- return Err ( Error :: UnsupportedUrlTokens ( urlb. into ( ) , url. protocol ) ) ;
57+ return Err ( Error :: UnsupportedUrlTokens ( urlb. into ( ) , url. scheme ) ) ;
5858 }
5959 Box :: new (
6060 crate :: client:: git:: connect (
@@ -67,9 +67,9 @@ pub fn connect(url: &[u8], version: crate::Protocol) -> Result<Box<dyn Transport
6767 )
6868 }
6969 #[ cfg( not( feature = "http-client-curl" ) ) ]
70- git_url:: Protocol :: Https | git_url:: Protocol :: Http => return Err ( Error :: CompiledWithoutHttp ( url. protocol ) ) ,
70+ git_url:: Scheme :: Https | git_url:: Scheme :: Http => return Err ( Error :: CompiledWithoutHttp ( url. scheme ) ) ,
7171 #[ cfg( feature = "http-client-curl" ) ]
72- git_url:: Protocol :: Https | git_url:: Protocol :: Http => {
72+ git_url:: Scheme :: Https | git_url:: Scheme :: Http => {
7373 use bstr:: ByteSlice ;
7474 Box :: new (
7575 crate :: client:: http:: connect ( urlb. to_str ( ) ?, version)
0 commit comments