Skip to content

Commit 62e6d8c

Browse files
authored
Make code rust 1.87.0 compatible (#1265)
1 parent 72d11d7 commit 62e6d8c

File tree

2 files changed

+12
-9
lines changed

2 files changed

+12
-9
lines changed

Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ name = "deebot_client"
33
version = "0.0.0"
44
edition = "2024"
55
authors = ["Robert Resch <[email protected]>"]
6+
rust-version = "1.87"
67

78
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
89
[lib]

src/map/map_info.rs

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -89,9 +89,11 @@ impl MapInfo {
8989
let mut used_styles = OrderSet::new();
9090

9191
for (map_info_type, css, force_connected) in order {
92-
if let Some(entries) = self.data.get(&map_info_type)
93-
&& !entries.is_empty()
94-
{
92+
if let Some(entries) = self.data.get(&map_info_type) {
93+
if entries.is_empty() {
94+
continue;
95+
}
96+
9597
let mut group = Group::new().set("class", get_class_names(&css));
9698
for entry in entries {
9799
if let Some(path) =
@@ -171,12 +173,12 @@ fn process_map_info_outline_entries(data: &[String]) -> Vec<MapInfoTypeDataEntry
171173

172174
for spec in parts {
173175
let mut coords = spec.splitn(3, ','); // coordinates are "x,y,type"
174-
if let (Some(x_str), Some(y_str)) = (coords.next(), coords.next())
175-
&& let (Ok(x), Ok(y)) = (x_str.parse::<f32>(), y_str.parse::<f32>())
176-
{
177-
let mut p = calc_point(x, y);
178-
p.connected = coords.next().unwrap_or("1").trim() != "3-1-0"; // lines to points of type "3-1-0" are not displayed
179-
path_points.push(p);
176+
if let (Some(x_str), Some(y_str)) = (coords.next(), coords.next()) {
177+
if let (Ok(x), Ok(y)) = (x_str.parse::<f32>(), y_str.parse::<f32>()) {
178+
let mut p = calc_point(x, y);
179+
p.connected = coords.next().unwrap_or("1").trim() != "3-1-0"; // lines to points of type "3-1-0" are not displayed
180+
path_points.push(p);
181+
}
180182
}
181183
}
182184

0 commit comments

Comments
 (0)