lib fix: swapped row/col on parse string

This commit is contained in:
Emilia Allison 2025-01-12 14:59:14 -05:00
parent 26526bb249
commit 1d2028959d
Signed by: emilia
GPG Key ID: 05D5D1107E5100A1
1 changed files with 2 additions and 3 deletions

View File

@ -101,7 +101,7 @@ impl Region {
log::info!("{:?}", input);
if let Some(captures) = RECT_REGEX.captures(input) {
if let (Some(row1), Some(col1), Some(row2), Some(col2)) = (
if let (Some(col1), Some(row1), Some(col2), Some(row2)) = (
crate::util::letters_to_num(&captures[1]),
captures[2].parse::<u8>().ok(),
crate::util::letters_to_num(&captures[3]),
@ -121,7 +121,7 @@ impl Region {
return None;
}
} else if let Some(captures) = POINT_REGEX.captures(input) {
if let (Some(row), Some(col)) = (
if let (Some(col), Some(row)) = (
crate::util::letters_to_num(&captures[1]),
captures[2].parse::<u8>().ok(),
) {
@ -461,7 +461,6 @@ impl TransferRegion {
return Err("Source region is out-of-bounds! (Too tall)");
}
if (s1.col > source_max.1 || s2.col > source_max.1) && il_dest.1 != 0 {
// log::debug!("s1.1: {}, max.1: {}", s1.1, source_max.1);
return Err("Source region is out-of-bounds! (Too wide)");
}