on master help sign in
Apply suggestions from code review

Co-authored-by: Ivan Tham <pickfire@riseup.net>

commitae105812d6c7ec20220d78d453f614438fbc5ba4 authorBrian Dawn <brian-dawn@users.noreply.github.com> dateSat 5 Jun 2021, 11:50 (5 years ago) parent255598a
3 files changed+4−8
README.md+1−2 book/src/install.md+1−1 helix-core/src/syntax.rs+2−5
README.md+1−2
@@ -45,7 +45,7 @@ the `HELIX_RUNTIME` environment variable.
4545> NOTE: You should set this to <path to repository>/runtime in development (if
4646> running via cargo).
4747
48−If you want to bake the `runtime/` directory into the Helix binary you can build
48+If you want to embed the `runtime/` directory into the Helix binary you can build
4949it with:
5050
5151```
@@ -82,4 +82,3 @@ All shortcuts/keymaps can be found in the documentation on the website:
8282# Getting help
8383
8484Discuss the project on the community [Matrix Space](https://matrix.to/#/#helix-community:matrix.org) (make sure to join `#helix-editor:matrix.org` if you're on a client that doesn't support Matrix Spaces yet).
85−
book/src/install.md+1−1
@@ -36,7 +36,7 @@ Now copy the `runtime/` directory somewhere. Helix will by default look for the
3636runtime inside the same folder as the executable, but that can be overriden via
3737the `HELIX_RUNTIME` environment variable.
3838
39−If you want to bake the `runtime/` directory into the Helix binary you can build
39+If you want to embed the `runtime/` directory into the Helix binary you can build
4040it with:
4141
4242```
helix-core/src/syntax.rs+2−5
@@ -81,10 +81,7 @@ fn load_runtime_file(language: &str, filename: &str) -> Result<String, std::io::
8181}
8282
8383#[cfg(feature = "embed_runtime")]
84−use rust_embed::RustEmbed;
85−
86−#[cfg(feature = "embed_runtime")]
87−#[derive(RustEmbed)]
84+#[derive(rust_embed::RustEmbed)]
8885#[folder = "../runtime/"]
8986struct Runtime;
9087
@@ -93,7 +90,7 @@ fn load_runtime_file(language: &str, filename: &str) -> Result<String, Box<dyn s
9390 let root = PathBuf::new();
9491 let path = root.join("queries").join(language).join(filename);
9592
96− let query_bytes = Runtime::get(&path.as_path().display().to_string()).unwrap_or_default();
93+ let query_bytes = Runtime::get(&path.display().to_string()).unwrap_or_default();
9794 std::str::from_utf8(query_bytes.as_ref())
9895 .map(|s| s.to_string())
9996 .map_err(|err| err.into())