mirror of
https://github.com/helix-editor/helix.git
synced 2024-11-23 01:46:18 +04:00
Merge pull request #57 from pickfire/fix-panic
Fix panic opening rust file
This commit is contained in:
commit
83031564db
@ -51,7 +51,8 @@ pub struct Args {
|
||||
files: Vec<PathBuf>,
|
||||
}
|
||||
|
||||
fn main() -> Result<()> {
|
||||
#[tokio::main]
|
||||
async fn main() -> Result<()> {
|
||||
let help = format!(
|
||||
"\
|
||||
{} {}
|
||||
@ -113,13 +114,9 @@ fn main() -> Result<()> {
|
||||
let config = toml::from_slice(toml).context("Could not parse languages.toml")?;
|
||||
LOADER.get_or_init(|| Loader::new(config));
|
||||
|
||||
let runtime = tokio::runtime::Runtime::new().context("unable to start tokio runtime")?;
|
||||
|
||||
// TODO: use the thread local executor to spawn the application task separately from the work pool
|
||||
let mut app = Application::new(args).context("unable to create new appliction")?;
|
||||
runtime.block_on(async move {
|
||||
app.run().await;
|
||||
});
|
||||
app.run().await;
|
||||
|
||||
Ok(())
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user