Replace unwrap with expect in setting RELM_THREADS
This commit is contained in:
parent
2014c83224
commit
5eb18e231f
1 changed files with 3 additions and 1 deletions
|
|
@ -27,7 +27,9 @@ fn main() {
|
||||||
let cores = thread::available_parallelism()
|
let cores = thread::available_parallelism()
|
||||||
.map(|cores| cores.get() - 2)
|
.map(|cores| cores.get() - 2)
|
||||||
.unwrap_or(1);
|
.unwrap_or(1);
|
||||||
relm4::RELM_THREADS.set(max(cores, 1)).unwrap();
|
relm4::RELM_THREADS
|
||||||
|
.set(max(cores, 1))
|
||||||
|
.expect("RELM_THREADS should not already be set");
|
||||||
|
|
||||||
app.run::<App>(());
|
app.run::<App>(());
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue