Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions keyberon/src/layout.rs
Original file line number Diff line number Diff line change
Expand Up @@ -748,13 +748,12 @@ impl<'a, T: std::fmt::Debug> WaitingState<'a, T> {
let res = match active {
Ok(active) => {
// Chording mode still active, only trigger action if it's unambiguous
if let Some(action) = config.get_chord_if_unambiguous(active) {
{
let action = config.get_chord_if_unambiguous(active)?;
if let Some(coord) = released_coord {
self.coord = coord;
}
(WaitingAction::Tap, action)
} else {
return None; // nothing to do yet, we'll check back later
}
}
Err(active) => {
Expand Down
8 changes: 1 addition & 7 deletions parser/src/cfg/defcfg.rs
Original file line number Diff line number Diff line change
Expand Up @@ -983,13 +983,7 @@ fn parse_cfg_val_u16(expr: &SExpr, label: &str, exclude_zero: bool) -> Result<u1
match &expr {
SExpr::Atom(v) => Ok(str::parse::<u16>(v.t.trim_atom_quotes())
.ok()
.and_then(|u| {
if exclude_zero && u == 0 {
None
} else {
Some(u)
}
})
.filter(|&u| !(exclude_zero && u == 0))
.ok_or_else(|| anyhow_expr!(expr, "{label} must be {start}-65535"))?),
SExpr::List(_) => {
bail_expr!(
Expand Down
2 changes: 1 addition & 1 deletion parser/src/cfg/macro.rs
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ pub(crate) fn parse_macro_item_impl<'a>(
let (held_mods, unparsed_str) =
parse_mods_held_for_submacro(&acs[0], s).map_err(|mut err| {
if err.msg == MACRO_ERR {
err.msg = format!("{}\n{MACRO_ERR}", &e.msg);
err.msg = format!("{}\n{MACRO_ERR}", e.msg);
}
err
})?;
Expand Down
2 changes: 1 addition & 1 deletion parser/src/cfg/sexpr.rs
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@ impl SExpr {
impl std::fmt::Debug for SExpr {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
match self {
SExpr::Atom(a) => write!(f, "{}", &a.t),
SExpr::Atom(a) => write!(f, "{}", a.t),
SExpr::List(l) => {
let inner =
l.t.iter()
Expand Down