mirror of
https://github.com/helix-editor/helix.git
synced 2025-04-06 04:17:43 +03:00
Simplify creating pathbufs.
Co-authored-by: Ivan Tham <pickfire@riseup.net>
This commit is contained in:
parent
ae105812d6
commit
676719b361
1 changed files with 1 additions and 2 deletions
|
@ -87,8 +87,7 @@ struct Runtime;
|
||||||
|
|
||||||
#[cfg(feature = "embed_runtime")]
|
#[cfg(feature = "embed_runtime")]
|
||||||
fn load_runtime_file(language: &str, filename: &str) -> Result<String, Box<dyn std::error::Error>> {
|
fn load_runtime_file(language: &str, filename: &str) -> Result<String, Box<dyn std::error::Error>> {
|
||||||
let root = PathBuf::new();
|
let path = PathBuf::from("queries").join(language).join(filename);
|
||||||
let path = root.join("queries").join(language).join(filename);
|
|
||||||
|
|
||||||
let query_bytes = Runtime::get(&path.display().to_string()).unwrap_or_default();
|
let query_bytes = Runtime::get(&path.display().to_string()).unwrap_or_default();
|
||||||
std::str::from_utf8(query_bytes.as_ref())
|
std::str::from_utf8(query_bytes.as_ref())
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue