mirror of
https://gitlab.com/gabmus/envision.git
synced 2025-04-20 19:44:50 +00:00
fix(builders): prefer unwrap_or to pattern matching
This commit is contained in:
parent
b2ea86211e
commit
c140d191c9
6 changed files with 72 additions and 48 deletions
|
@ -13,15 +13,21 @@ pub fn get_build_basalt_jobs(profile: &Profile, clean_build: bool) -> VecDeque<W
|
|||
let mut jobs = VecDeque::<WorkerJob>::new();
|
||||
|
||||
let git = Git {
|
||||
repo: match profile.features.basalt.repo.as_ref() {
|
||||
Some(r) => r.clone(),
|
||||
None => "https://gitlab.freedesktop.org/mateosss/basalt.git".into(),
|
||||
},
|
||||
repo: profile
|
||||
.features
|
||||
.basalt
|
||||
.repo
|
||||
.as_ref()
|
||||
.unwrap_or(&"https://gitlab.freedesktop.org/mateosss/basalt.git".into())
|
||||
.clone(),
|
||||
dir: profile.features.basalt.path.as_ref().unwrap().clone(),
|
||||
branch: match profile.features.basalt.branch.as_ref() {
|
||||
Some(r) => r.clone(),
|
||||
None => "main".into(),
|
||||
},
|
||||
branch: profile
|
||||
.features
|
||||
.basalt
|
||||
.branch
|
||||
.as_ref()
|
||||
.unwrap_or(&"main".into())
|
||||
.clone(),
|
||||
};
|
||||
|
||||
jobs.extend(git.get_pre_build_jobs(profile.pull_on_build));
|
||||
|
|
|
@ -13,15 +13,21 @@ pub fn get_build_libsurvive_jobs(profile: &Profile, clean_build: bool) -> VecDeq
|
|||
let mut jobs = VecDeque::<WorkerJob>::new();
|
||||
|
||||
let git = Git {
|
||||
repo: match profile.features.libsurvive.repo.as_ref() {
|
||||
Some(r) => r.clone(),
|
||||
None => "https://github.com/cntools/libsurvive".into(),
|
||||
},
|
||||
repo: profile
|
||||
.features
|
||||
.libsurvive
|
||||
.repo
|
||||
.as_ref()
|
||||
.unwrap_or(&"https://github.com/cntools/libsurvive".into())
|
||||
.clone(),
|
||||
dir: profile.features.libsurvive.path.as_ref().unwrap().clone(),
|
||||
branch: match profile.features.libsurvive.branch.as_ref() {
|
||||
Some(r) => r.clone(),
|
||||
None => "master".into(),
|
||||
},
|
||||
branch: profile
|
||||
.features
|
||||
.libsurvive
|
||||
.branch
|
||||
.as_ref()
|
||||
.unwrap_or(&"master".into())
|
||||
.clone(),
|
||||
};
|
||||
|
||||
jobs.extend(git.get_pre_build_jobs(profile.pull_on_build));
|
||||
|
|
|
@ -13,15 +13,17 @@ pub fn get_build_monado_jobs(profile: &Profile, clean_build: bool) -> VecDeque<W
|
|||
let mut jobs = VecDeque::<WorkerJob>::new();
|
||||
|
||||
let git = Git {
|
||||
repo: match profile.xrservice_repo.as_ref() {
|
||||
Some(r) => r.clone(),
|
||||
None => "https://gitlab.freedesktop.org/monado/monado".into(),
|
||||
},
|
||||
repo: profile
|
||||
.xrservice_repo
|
||||
.as_ref()
|
||||
.unwrap_or(&"https://gitlab.freedesktop.org/monado/monado".into())
|
||||
.clone(),
|
||||
dir: profile.xrservice_path.clone(),
|
||||
branch: match profile.xrservice_branch.as_ref() {
|
||||
Some(r) => r.clone(),
|
||||
None => "main".into(),
|
||||
},
|
||||
branch: profile
|
||||
.xrservice_branch
|
||||
.as_ref()
|
||||
.unwrap_or(&"main".into())
|
||||
.clone(),
|
||||
};
|
||||
|
||||
jobs.extend(git.get_pre_build_jobs(profile.pull_on_build));
|
||||
|
|
|
@ -13,15 +13,17 @@ pub fn get_build_opencomposite_jobs(profile: &Profile, clean_build: bool) -> Vec
|
|||
let mut jobs = VecDeque::<WorkerJob>::new();
|
||||
|
||||
let git = Git {
|
||||
repo: match profile.opencomposite_repo.as_ref() {
|
||||
Some(r) => r.clone(),
|
||||
None => "https://gitlab.com/znixian/OpenOVR.git".into(),
|
||||
},
|
||||
repo: profile
|
||||
.opencomposite_repo
|
||||
.as_ref()
|
||||
.unwrap_or(&"https://gitlab.com/znixian/OpenOVR.git".into())
|
||||
.clone(),
|
||||
dir: profile.opencomposite_path.clone(),
|
||||
branch: match profile.opencomposite_branch.as_ref() {
|
||||
Some(r) => r.clone(),
|
||||
None => "openxr".into(),
|
||||
},
|
||||
branch: profile
|
||||
.opencomposite_branch
|
||||
.as_ref()
|
||||
.unwrap_or(&"openxr".into())
|
||||
.clone(),
|
||||
};
|
||||
|
||||
jobs.extend(git.get_pre_build_jobs(profile.pull_on_build));
|
||||
|
|
|
@ -13,15 +13,21 @@ pub fn get_build_openhmd_jobs(profile: &Profile, clean_build: bool) -> VecDeque<
|
|||
let mut jobs = VecDeque::<WorkerJob>::new();
|
||||
|
||||
let git = Git {
|
||||
repo: match profile.features.openhmd.repo.as_ref() {
|
||||
Some(r) => r.clone(),
|
||||
None => "https://github.com/OpenHMD/OpenHMD".into(),
|
||||
},
|
||||
repo: profile
|
||||
.features
|
||||
.openhmd
|
||||
.repo
|
||||
.as_ref()
|
||||
.unwrap_or(&"https://github.com/OpenHMD/OpenHMD".into())
|
||||
.clone(),
|
||||
dir: profile.features.openhmd.path.as_ref().unwrap().clone(),
|
||||
branch: match profile.features.openhmd.branch.as_ref() {
|
||||
Some(r) => r.clone(),
|
||||
None => "master".into(),
|
||||
},
|
||||
branch: profile
|
||||
.features
|
||||
.openhmd
|
||||
.branch
|
||||
.as_ref()
|
||||
.unwrap_or(&"master".into())
|
||||
.clone(),
|
||||
};
|
||||
|
||||
jobs.extend(git.get_pre_build_jobs(profile.pull_on_build));
|
||||
|
|
|
@ -13,15 +13,17 @@ pub fn get_build_wivrn_jobs(profile: &Profile, clean_build: bool) -> VecDeque<Wo
|
|||
let mut jobs = VecDeque::<WorkerJob>::new();
|
||||
|
||||
let git = Git {
|
||||
repo: match profile.xrservice_repo.as_ref() {
|
||||
Some(r) => r.clone(),
|
||||
None => "https://github.com/Meumeu/WiVRn".into(),
|
||||
},
|
||||
repo: profile
|
||||
.xrservice_repo
|
||||
.as_ref()
|
||||
.unwrap_or(&"https://github.com/Meumeu/WiVRn".into())
|
||||
.clone(),
|
||||
dir: profile.xrservice_path.clone(),
|
||||
branch: match profile.xrservice_branch.as_ref() {
|
||||
Some(r) => r.clone(),
|
||||
None => "master".into(),
|
||||
},
|
||||
branch: profile
|
||||
.xrservice_branch
|
||||
.as_ref()
|
||||
.unwrap_or(&"master".into())
|
||||
.clone(),
|
||||
};
|
||||
|
||||
jobs.extend(git.get_pre_build_jobs(profile.pull_on_build));
|
||||
|
|
Loading…
Add table
Reference in a new issue