File tree Expand file tree Collapse file tree 1 file changed +5
-8
lines changed Expand file tree Collapse file tree 1 file changed +5
-8
lines changed Original file line number Diff line number Diff line change @@ -203,17 +203,14 @@ See rust-openssl documentation for more information:
203203 let libressl_prefix = "RUST_VERSION_LIBRESSL_" ;
204204 let boringsl_prefix = "RUST_OPENSSL_IS_BORINGSSL" ;
205205 let conf_prefix = "RUST_CONF_" ;
206- if line. starts_with ( openssl_prefix) {
207- let version = & line[ openssl_prefix. len ( ) ..] ;
206+ if let Some ( version) = line. strip_prefix ( openssl_prefix) {
208207 openssl_version = Some ( parse_version ( version) ) ;
209- } else if line. starts_with ( new_openssl_prefix) {
210- let version = & line[ new_openssl_prefix. len ( ) ..] ;
208+ } else if let Some ( version) = line. strip_prefix ( new_openssl_prefix) {
211209 openssl_version = Some ( parse_new_version ( version) ) ;
212- } else if line. starts_with ( libressl_prefix) {
213- let version = & line[ libressl_prefix. len ( ) ..] ;
210+ } else if let Some ( version) = line. strip_prefix ( libressl_prefix) {
214211 libressl_version = Some ( parse_version ( version) ) ;
215- } else if line. starts_with ( conf_prefix) {
216- enabled. push ( & line [ conf_prefix . len ( ) .. ] ) ;
212+ } else if let Some ( conf ) = line. strip_prefix ( conf_prefix) {
213+ enabled. push ( conf ) ;
217214 } else if line. starts_with ( boringsl_prefix) {
218215 is_boringssl = true ;
219216 }
You can’t perform that action at this time.
0 commit comments