File tree 1 file changed +5
-8
lines changed 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:
203
203
let libressl_prefix = "RUST_VERSION_LIBRESSL_" ;
204
204
let boringsl_prefix = "RUST_OPENSSL_IS_BORINGSSL" ;
205
205
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) {
208
207
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) {
211
209
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) {
214
211
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 ) ;
217
214
} else if line. starts_with ( boringsl_prefix) {
218
215
is_boringssl = true ;
219
216
}
You can’t perform that action at this time.
0 commit comments