mirror of
https://github.com/Zenithsiz/zsw.git
synced 2026-02-04 02:08:37 +00:00
Arguments are no longer arced.
This commit is contained in:
parent
43e8e35b20
commit
392d817c3e
@ -41,7 +41,7 @@ use {
|
||||
};
|
||||
|
||||
/// Runs the application
|
||||
pub async fn run(args: Arc<Args>) -> Result<(), anyhow::Error> {
|
||||
pub async fn run(args: &Args) -> Result<(), anyhow::Error> {
|
||||
// Build the window
|
||||
let (mut event_loop, window) = self::create_window()?;
|
||||
let window = Arc::new(window);
|
||||
@ -55,7 +55,7 @@ pub async fn run(args: Arc<Args>) -> Result<(), anyhow::Error> {
|
||||
let mut event_handler = EventHandler::new();
|
||||
|
||||
// Spawn all futures
|
||||
let join_handle = self::spawn_services(&services, &resources, &args);
|
||||
let join_handle = self::spawn_services(&services, &resources, args);
|
||||
|
||||
// Run the event loop until exit
|
||||
event_loop.run_return(|event, _, control_flow| {
|
||||
|
||||
@ -84,10 +84,7 @@ use {
|
||||
clap::StructOpt,
|
||||
std::{
|
||||
num::NonZeroUsize,
|
||||
sync::{
|
||||
atomic::{self, AtomicUsize},
|
||||
Arc,
|
||||
},
|
||||
sync::atomic::{self, AtomicUsize},
|
||||
thread,
|
||||
},
|
||||
};
|
||||
@ -106,7 +103,7 @@ fn main() -> Result<(), anyhow::Error> {
|
||||
|
||||
// Get arguments
|
||||
let args = match Args::try_parse() {
|
||||
Ok(args) => Arc::new(args),
|
||||
Ok(args) => args,
|
||||
Err(err) => {
|
||||
tracing::warn!(?err, "Unable to retrieve arguments");
|
||||
err.exit();
|
||||
@ -133,7 +130,7 @@ fn main() -> Result<(), anyhow::Error> {
|
||||
// Run the app and restart if we get an error (up to 5 errors)
|
||||
let mut errors = 0;
|
||||
while errors < 5 {
|
||||
match runtime.block_on(app::run(Arc::clone(&args))) {
|
||||
match runtime.block_on(app::run(&args)) {
|
||||
Ok(()) => {
|
||||
tracing::info!("Application finished");
|
||||
break;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user