on master help sign in
Merge pull request #57 from pickfire/fix-panic

Fix panic opening rust file

commit83031564dba3fa78d50b9ea4602e54aba82df763 authorCorey Powell <mistdragon100@gmail.com> dateWed 2 Jun 2021, 13:14 (5 years ago) parent2719a35eab6e53
1 file changed+3−6
helix-term/src/main.rs+3−6
helix-term/src/main.rs+3−6
@@ -51,7 +51,8 @@ pub struct Args {
5151 files: Vec<PathBuf>,
5252}
5353
54−fn main() -> Result<()> {
54+#[tokio::main]
55+async fn main() -> Result<()> {
5556 let help = format!(
5657 "\
5758{} {}
@@ -113,13 +114,9 @@ FLAGS:
113114 let config = toml::from_slice(toml).context("Could not parse languages.toml")?;
114115 LOADER.get_or_init(|| Loader::new(config));
115116
116− let runtime = tokio::runtime::Runtime::new().context("unable to start tokio runtime")?;
117−
118117 // TODO: use the thread local executor to spawn the application task separately from the work pool
119118 let mut app = Application::new(args).context("unable to create new appliction")?;
120− runtime.block_on(async move {
121− app.run().await;
122− });
119+ app.run().await;
123120
124121 Ok(())
125122}