Skip to content

Commit

Permalink
fix failing build
Browse files Browse the repository at this point in the history
  • Loading branch information
rszyma committed Jun 1, 2024
1 parent 7c564ea commit 4617b2e
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 7 deletions.
13 changes: 12 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,19 @@
{
"rust-analyzer.cargo.target": "wasm32-unknown-unknown",
"rust-analyzer.cargo.features": "all",
// https://github.com/rust-lang/rust-analyzer/issues/10298
// "rust-analyzer.cargo.features": [
// "cmd",
// "gui",
// "interception_driver"
// ],
"eslint.format.enable": true,
"[typescript]": {
"editor.defaultFormatter": "dbaeumer.vscode-eslint"
},
// https://github.com/rust-lang/rust-analyzer/issues/8521
// "rust-analyzer.linkedProjects": [
// "./kls/Cargo.toml",
// "./kanata-local/parser/Cargo.toml",
// "./kanata/parser/Cargo.toml",
// ],
}
15 changes: 9 additions & 6 deletions kls/src/formatter/defsrc_layout/mod.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
use std::fmt::Display;

use super::ext_tree::*;
use crate::log;
use anyhow::{anyhow, Ok};
use anyhow::anyhow;
use unicode_segmentation::*;

pub mod get_layout;
Expand Down Expand Up @@ -314,12 +316,13 @@ pub enum LineEndingSequence {
CRLF,
}

impl ToString for LineEndingSequence {
fn to_string(&self) -> String {
impl Display for LineEndingSequence {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
match self {
LineEndingSequence::LF => "\n".to_string(),
LineEndingSequence::CRLF => "\r\n".to_string(),
}
LineEndingSequence::LF => f.write_str("\n"),
LineEndingSequence::CRLF => f.write_str("\r\n"),
}?;
Ok(())
}
}

Expand Down

0 comments on commit 4617b2e

Please sign in to comment.