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
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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


Expand Down
4 changes: 2 additions & 2 deletions src/canonicalize.rs
Original file line number Diff line number Diff line change
Expand Up @@ -382,7 +382,7 @@ pub fn replace_children<'a>(mathml: Element<'a>, replacements: Vec<Element<'a>>)
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 {
Expand Down Expand Up @@ -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) {
Expand Down
4 changes: 2 additions & 2 deletions src/speech.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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::<Vec<Yaml>>()
)
},
Yaml::Hash(ref h) => {
Yaml::Hash(h) => {
Yaml::Hash(
h.iter()
.map(|(key,val)| (key.clone(), substitute_ch(val, ch)) )
Expand Down
Loading