diff --git a/Cargo.toml b/Cargo.toml index d8ba6280..bf013e23 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -7,7 +7,7 @@ description = "MathCAT: Math Capable Assistive Technology ('Speech and braille f repository = "https://github.com/NSoiffer/MathCAT" homepage = "https://nsoiffer.github.io/MathCAT/" documentation = "https://nsoiffer.github.io/MathCAT/" -edition = "2018" +edition = "2024" exclude = ["src/main.rs", "docs", "PythonScripts"] # should have "Rules/", but then one can't run build.rs to build the zip file diff --git a/src/canonicalize.rs b/src/canonicalize.rs index 52cd0b6b..7dadd054 100644 --- a/src/canonicalize.rs +++ b/src/canonicalize.rs @@ -382,7 +382,7 @@ pub fn replace_children<'a>(mathml: Element<'a>, replacements: Vec>) pub fn get_presentation_element(element: Element) -> (usize, Element) { assert_eq!(name(element), "semantics"); let children = element.children(); - if let Some( (i, child) ) = children.iter().enumerate().find(|(_, &child)| + if let Some( (i, child) ) = children.iter().enumerate().find(|&(_, &child)| if let Some(encoding) = as_element(child).attribute_value("encoding") { encoding == "MathML-Presentation" } else { @@ -1502,7 +1502,7 @@ impl CanonicalizeContext { let n = children.len(); let i_mprescripts = if let Some((i,_)) = children.iter().enumerate() - .find(|(_,&el)| name(as_element(el)) == "mprescripts") { i } else { n }; + .find(|&(_,&el)| name(as_element(el)) == "mprescripts") { i } else { n }; let has_misplaced_mprescripts = i_mprescripts & 1 == 0; // should be first, third, ... child let mut has_proper_number_of_children = if i_mprescripts == n { n & 1 == 0} else { n & 1 != 0 }; // should be odd else even # if has_misplaced_mprescripts || !has_proper_number_of_children || has_none_none_script_pair(&children) { diff --git a/src/speech.rs b/src/speech.rs index be0b40cf..5a85ebe4 100644 --- a/src/speech.rs +++ b/src/speech.rs @@ -1895,14 +1895,14 @@ impl UnicodeDef { fn substitute_ch(yaml: &Yaml, ch: &str) -> Yaml { return match yaml { - Yaml::Array(ref v) => { + Yaml::Array(v) => { Yaml::Array( v.iter() .map(|e| substitute_ch(e, ch)) .collect::>() ) }, - Yaml::Hash(ref h) => { + Yaml::Hash(h) => { Yaml::Hash( h.iter() .map(|(key,val)| (key.clone(), substitute_ch(val, ch)) )