Dogfood 'str_split_once() with compiler/
This commit is contained in:
@@ -15,6 +15,7 @@
|
||||
#![feature(never_type)]
|
||||
#![feature(associated_type_bounds)]
|
||||
#![feature(exhaustive_patterns)]
|
||||
#![feature(str_split_once)]
|
||||
|
||||
#[macro_use]
|
||||
extern crate rustc_macros;
|
||||
|
||||
@@ -54,10 +54,7 @@ fn macos_deployment_target() -> (u32, u32) {
|
||||
let deployment_target = env::var("MACOSX_DEPLOYMENT_TARGET").ok();
|
||||
let version = deployment_target
|
||||
.as_ref()
|
||||
.and_then(|s| {
|
||||
let mut i = s.splitn(2, '.');
|
||||
i.next().and_then(|a| i.next().map(|b| (a, b)))
|
||||
})
|
||||
.and_then(|s| s.split_once('.'))
|
||||
.and_then(|(a, b)| a.parse::<u32>().and_then(|a| b.parse::<u32>().map(|b| (a, b))).ok());
|
||||
|
||||
version.unwrap_or((10, 7))
|
||||
|
||||
Reference in New Issue
Block a user