From 691cc449ddf37d74f307af953d1f4046bd0674df Mon Sep 17 00:00:00 2001 From: Jeff Garzik Date: Sat, 6 Dec 2025 16:13:32 -0500 Subject: [PATCH 1/2] [bc] box large error results (clippy warning) --- calc/bc_util/parser.rs | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/calc/bc_util/parser.rs b/calc/bc_util/parser.rs index 2764e9706..ae123a2b7 100644 --- a/calc/bc_util/parser.rs +++ b/calc/bc_util/parser.rs @@ -263,7 +263,7 @@ fn parse_stmt( in_loop: bool, statements: &mut Vec, source_locations: &mut Vec, -) -> Result { +) -> Result> { let stmt = first_child(stmt); let (line, _) = stmt.line_col(); source_locations.push(line); @@ -271,12 +271,12 @@ fn parse_stmt( match stmt.as_rule() { Rule::break_stmt => { if !in_loop { - return Err(pest::error::Error::new_from_span( + return Err(Box::new(pest::error::Error::new_from_span( pest::error::ErrorVariant::CustomError { message: "break outside of loop".to_string(), }, stmt.as_span(), - )); + ))); } statements.push(StmtInstruction::Break); } @@ -286,12 +286,12 @@ fn parse_stmt( Rule::return_stmt => { // return ( "(" expr? ")" )? if !in_function { - return Err(pest::error::Error::new_from_span( + return Err(Box::new(pest::error::Error::new_from_span( pest::error::ErrorVariant::CustomError { message: "return outside of function".to_string(), }, stmt.as_span(), - )); + ))); } let mut inner = stmt.into_inner(); if let Some(expr) = inner.next() { @@ -381,7 +381,7 @@ fn parse_stmt( Ok(instruction_count) } -fn parse_function(func: Pair, file: Rc) -> Result { +fn parse_function(func: Pair, file: Rc) -> Result> { let mut function = func.into_inner(); // define letter ( parameter_list ) auto_define_list statement_list end @@ -586,7 +586,7 @@ pub fn parse_program(text: &str, file_path: Option<&str>) -> Result) -> Result errors.push(e), + Err(e) => errors.push(*e), }, Rule::EOI => {} _ => unreachable!(), From 78b9a1ef940bf9583dfa9384991f82414928902b Mon Sep 17 00:00:00 2001 From: Jeff Garzik Date: Sat, 6 Dec 2025 16:30:12 -0500 Subject: [PATCH 2/2] [stty] ignore clippy warning --- screen/stty.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/screen/stty.rs b/screen/stty.rs index 195475870..b97651d73 100644 --- a/screen/stty.rs +++ b/screen/stty.rs @@ -190,6 +190,7 @@ fn stty_show_long(ti: Termios) -> io::Result<()> { } // display compact, parse-able form stty values +#[allow(clippy::unnecessary_cast)] // tcflag_t is u64 on macOS, u32 on Linux fn stty_show_compact(ti: Termios) -> io::Result<()> { // encode settings as pairs of (String,u64) let mut tiv = vec![