on master help sign in
Fix panic opening rust file
eab6e53Ivan Tham
helix-term/src/main.rs+3−6
@@ -51,7 +51,8 @@ pub struct Args {
51 files: Vec<PathBuf>,
51 files: Vec<PathBuf>,
52}
52}
53
53
54+#[tokio::main]
54−fn main() -> Result<()> {
55+async fn main() -> Result<()> {
55 let help = format!(
56 let help = format!(
56 "\
57 "\
57{} {}
58{} {}
@@ -113,13 +114,9 @@ FLAGS:
113 let config = toml::from_slice(toml).context("Could not parse languages.toml")?;
114 let config = toml::from_slice(toml).context("Could not parse languages.toml")?;
114 LOADER.get_or_init(|| Loader::new(config));
115 LOADER.get_or_init(|| Loader::new(config));
115
116
116− let runtime = tokio::runtime::Runtime::new().context("unable to start tokio runtime")?;
117−
118 // TODO: use the thread local executor to spawn the application task separately from the work pool
117 // TODO: use the thread local executor to spawn the application task separately from the work pool
119 let mut app = Application::new(args).context("unable to create new appliction")?;
118 let mut app = Application::new(args).context("unable to create new appliction")?;
120− runtime.block_on(async move {
121− app.run().await;
119+ app.run().await;
122− });
123
120
124 Ok(())
121 Ok(())
125}
122}