[INFO] fetching crate polygon-offsetting 0.1.9... [INFO] linting polygon-offsetting-0.1.9 against nightly for clippy-nonminimal_bool-denied [INFO] extracting crate polygon-offsetting 0.1.9 into /workspace/builds/worker-2-tc1/source [INFO] started tweaking crates.io crate polygon-offsetting 0.1.9 [INFO] finished tweaking crates.io crate polygon-offsetting 0.1.9 [INFO] tweaked toml for crates.io crate polygon-offsetting 0.1.9 written to /workspace/builds/worker-2-tc1/source/Cargo.toml [INFO] validating manifest of crates.io crate polygon-offsetting 0.1.9 on toolchain nightly [INFO] running `Command { std: CARGO_HOME="/workspace/cargo-home" RUSTUP_HOME="/workspace/rustup-home" "/workspace/cargo-home/bin/cargo" "+nightly" "metadata" "--manifest-path" "Cargo.toml" "--no-deps", kill_on_drop: false }` [INFO] crate crates.io crate polygon-offsetting 0.1.9 already has a lockfile, it will not be regenerated [INFO] running `Command { std: CARGO_HOME="/workspace/cargo-home" RUSTUP_HOME="/workspace/rustup-home" "/workspace/cargo-home/bin/cargo" "+nightly" "fetch" "--manifest-path" "Cargo.toml", kill_on_drop: false }` [INFO] running `Command { std: "docker" "create" "-v" "/var/lib/crater-agent-workspace/builds/worker-2-tc1/target:/opt/rustwide/target:rw,Z" "-v" "/var/lib/crater-agent-workspace/builds/worker-2-tc1/source:/opt/rustwide/workdir:ro,Z" "-v" "/var/lib/crater-agent-workspace/cargo-home:/opt/rustwide/cargo-home:ro,Z" "-v" "/var/lib/crater-agent-workspace/rustup-home:/opt/rustwide/rustup-home:ro,Z" "-e" "SOURCE_DIR=/opt/rustwide/workdir" "-e" "CARGO_TARGET_DIR=/opt/rustwide/target" "-e" "CARGO_HOME=/opt/rustwide/cargo-home" "-e" "RUSTUP_HOME=/opt/rustwide/rustup-home" "-w" "/opt/rustwide/workdir" "-m" "1610612736" "--user" "0:0" "--network" "none" "ghcr.io/rust-lang/crates-build-env/linux@sha256:d429b63d4308055ea97f60fb1d3dfca48854a00942f1bd2ad806beaf015945ec" "/opt/rustwide/cargo-home/bin/cargo" "+nightly" "metadata" "--no-deps" "--format-version=1", kill_on_drop: false }` [INFO] [stdout] ac88d879208f4dd5e4b77fb43ca43f0e89a5329f89718d741b7fc142f27bd62d [INFO] running `Command { std: "docker" "start" "-a" "ac88d879208f4dd5e4b77fb43ca43f0e89a5329f89718d741b7fc142f27bd62d", kill_on_drop: false }` [INFO] running `Command { std: "docker" "inspect" "ac88d879208f4dd5e4b77fb43ca43f0e89a5329f89718d741b7fc142f27bd62d", kill_on_drop: false }` [INFO] running `Command { std: "docker" "rm" "-f" "ac88d879208f4dd5e4b77fb43ca43f0e89a5329f89718d741b7fc142f27bd62d", kill_on_drop: false }` [INFO] [stdout] ac88d879208f4dd5e4b77fb43ca43f0e89a5329f89718d741b7fc142f27bd62d [INFO] running `Command { std: "docker" "create" "-v" "/var/lib/crater-agent-workspace/builds/worker-2-tc1/target:/opt/rustwide/target:rw,Z" "-v" "/var/lib/crater-agent-workspace/builds/worker-2-tc1/source:/opt/rustwide/workdir:ro,Z" "-v" "/var/lib/crater-agent-workspace/cargo-home:/opt/rustwide/cargo-home:ro,Z" "-v" "/var/lib/crater-agent-workspace/rustup-home:/opt/rustwide/rustup-home:ro,Z" "-e" "SOURCE_DIR=/opt/rustwide/workdir" "-e" "CARGO_TARGET_DIR=/opt/rustwide/target" "-e" "CARGO_INCREMENTAL=0" "-e" "RUST_BACKTRACE=full" "-e" "RUSTFLAGS=--cap-lints=forbid" "-e" "RUSTDOCFLAGS=--cap-lints=forbid" "-e" "CARGO_HOME=/opt/rustwide/cargo-home" "-e" "RUSTUP_HOME=/opt/rustwide/rustup-home" "-w" "/opt/rustwide/workdir" "-m" "1610612736" "--user" "0:0" "--network" "none" "ghcr.io/rust-lang/crates-build-env/linux@sha256:d429b63d4308055ea97f60fb1d3dfca48854a00942f1bd2ad806beaf015945ec" "/opt/rustwide/cargo-home/bin/cargo" "+nightly" "clippy" "--frozen" "--all" "--all-targets" "--message-format=json", kill_on_drop: false }` [INFO] [stdout] 177df172a92458e602d9f043100f59ba98faac0efd6ee76c8178c8e5a880159a [INFO] running `Command { std: "docker" "start" "-a" "177df172a92458e602d9f043100f59ba98faac0efd6ee76c8178c8e5a880159a", kill_on_drop: false }` [INFO] [stderr] Checking polygon-offsetting v0.1.9 (/opt/rustwide/workdir) [INFO] [stdout] warning: redundant field names in struct initialization [INFO] [stdout] --> src/polygon_offsetting.rs:119:31 [INFO] [stdout] | [INFO] [stdout] 119 | dots.push(Vertex {x: x, y: y, is_intersect: false}); [INFO] [stdout] | ^^^^ help: replace it with: `x` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_field_names [INFO] [stdout] = note: `#[warn(clippy::redundant_field_names)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant field names in struct initialization [INFO] [stdout] --> src/polygon_offsetting.rs:119:37 [INFO] [stdout] | [INFO] [stdout] 119 | dots.push(Vertex {x: x, y: y, is_intersect: false}); [INFO] [stdout] | ^^^^ help: replace it with: `y` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_field_names [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/polygon_offsetting.rs:39:27 [INFO] [stdout] | [INFO] [stdout] 39 | fn compute_area(contours: &Vec<(f64, f64)>) -> f64 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] = note: `#[warn(clippy::ptr_arg)]` on by default [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 39 - fn compute_area(contours: &Vec<(f64, f64)>) -> f64 { [INFO] [stdout] 39 + fn compute_area(contours: &[(f64, f64)]) -> f64 { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/polygon_offsetting.rs:41:8 [INFO] [stdout] | [INFO] [stdout] 41 | if contours.len() == 0 { return 0.0 } [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `contours.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero [INFO] [stdout] = note: `#[warn(clippy::len_zero)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/polygon_offsetting.rs:48:33 [INFO] [stdout] | [INFO] [stdout] 48 | fn compute_perimeter(contour2d: &Vec<(f64, f64)>) -> f64 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 48 - fn compute_perimeter(contour2d: &Vec<(f64, f64)>) -> f64 { [INFO] [stdout] 48 + fn compute_perimeter(contour2d: &[(f64, f64)]) -> f64 { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/polygon_offsetting.rs:74:28 [INFO] [stdout] | [INFO] [stdout] 74 | fn reverse_segments(sgmts: &Vec) -> Vec { [INFO] [stdout] | ^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 74 - fn reverse_segments(sgmts: &Vec) -> Vec { [INFO] [stdout] 74 + fn reverse_segments(sgmts: &[Segment]) -> Vec { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of an assign operation [INFO] [stdout] --> src/polygon_offsetting.rs:93:32 [INFO] [stdout] | [INFO] [stdout] 93 | if start_angle < 0. { start_angle = 2. * std::f64::consts::PI + start_angle } [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace it with: `start_angle += 2. * std::f64::consts::PI` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#assign_op_pattern [INFO] [stdout] = note: `#[warn(clippy::assign_op_pattern)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of an assign operation [INFO] [stdout] --> src/polygon_offsetting.rs:94:32 [INFO] [stdout] | [INFO] [stdout] 94 | if end_angle <= 0. { end_angle = 2. * std::f64::consts::PI + end_angle } [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace it with: `end_angle += 2. * std::f64::consts::PI` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#assign_op_pattern [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: returning the result of a `let` binding from a block [INFO] [stdout] --> src/polygon_offsetting.rs:142:9 [INFO] [stdout] | [INFO] [stdout] 137 | / let v_cross = Some(Vertex { [INFO] [stdout] 138 | | x: e1.0.x + ua * (e1.1.x - e1.0.x), [INFO] [stdout] 139 | | y: e1.0.y + ua * (e1.1.y - e1.0.y), [INFO] [stdout] 140 | | is_intersect: is_inters [INFO] [stdout] 141 | | }); [INFO] [stdout] | |___________- unnecessary `let` binding [INFO] [stdout] 142 | v_cross [INFO] [stdout] | ^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#let_and_return [INFO] [stdout] = note: `#[warn(clippy::let_and_return)]` on by default [INFO] [stdout] help: return the expression directly [INFO] [stdout] | [INFO] [stdout] 137 ~ [INFO] [stdout] 138 ~ Some(Vertex { [INFO] [stdout] 139 + x: e1.0.x + ua * (e1.1.x - e1.0.x), [INFO] [stdout] 140 + y: e1.0.y + ua * (e1.1.y - e1.0.y), [INFO] [stdout] 141 + is_intersect: is_inters [INFO] [stdout] 142 + }) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `unwrap` on `vertex` after checking its variant with `is_none` [INFO] [stdout] --> src/polygon_offsetting.rs:188:40 [INFO] [stdout] | [INFO] [stdout] 176 | if vertex.is_none() { [INFO] [stdout] | ------------------- help: try: `if let Some() = vertex` [INFO] [stdout] ... [INFO] [stdout] 188 | vertices.insert(index, vertex.unwrap()); [INFO] [stdout] | ^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_unwrap [INFO] [stdout] = note: `#[warn(clippy::unnecessary_unwrap)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: returning the result of a `let` binding from a block [INFO] [stdout] --> src/polygon_offsetting.rs:195:9 [INFO] [stdout] | [INFO] [stdout] 194 | let margin_polygon = self.create_polygon(vertices, self.offset_margin, false); [INFO] [stdout] | ------------------------------------------------------------------------------ unnecessary `let` binding [INFO] [stdout] 195 | margin_polygon [INFO] [stdout] | ^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#let_and_return [INFO] [stdout] help: return the expression directly [INFO] [stdout] | [INFO] [stdout] 194 ~ [INFO] [stdout] 195 ~ self.create_polygon(vertices, self.offset_margin, false) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/polygon_offsetting.rs:204:54 [INFO] [stdout] | [INFO] [stdout] 204 | cross_coord.push((*c, *poly.vertices.get(&c).unwrap())); [INFO] [stdout] | ^^ help: change this to: `c` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] = note: `#[warn(clippy::needless_borrow)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `i` is only used to index `cross_coord` [INFO] [stdout] --> src/polygon_offsetting.rs:207:18 [INFO] [stdout] | [INFO] [stdout] 207 | for i in 0..cross_coord.len() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_range_loop [INFO] [stdout] = note: `#[warn(clippy::needless_range_loop)]` on by default [INFO] [stdout] help: consider using an iterator [INFO] [stdout] | [INFO] [stdout] 207 - for i in 0..cross_coord.len() { [INFO] [stdout] 207 + for in &cross_coord { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this boolean expression can be simplified [INFO] [stdout] --> src/polygon_offsetting.rs:248:24 [INFO] [stdout] | [INFO] [stdout] 248 | if !inters.is_none() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ help: try: `inters.is_some()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#nonminimal_bool [INFO] [stdout] = note: `#[warn(clippy::nonminimal_bool)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `unwrap` on `inters` after checking its variant with `is_none` [INFO] [stdout] --> src/polygon_offsetting.rs:249:59 [INFO] [stdout] | [INFO] [stdout] 248 | if !inters.is_none() { [INFO] [stdout] | ---------------- the check is happening here [INFO] [stdout] 249 | vertices.insert(max_vertices + 1, inters.unwrap()); [INFO] [stdout] | ^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: try using `match` [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_unwrap [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` can be collapsed into the outer `match` [INFO] [stdout] --> src/polygon_offsetting.rs:254:33 [INFO] [stdout] | [INFO] [stdout] 254 | / ... if !v.contains(&max_vertices) { [INFO] [stdout] 255 | | ... v.push(max_vertices); [INFO] [stdout] 256 | | ... } [INFO] [stdout] | |_______________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_match [INFO] [stdout] = note: `#[warn(clippy::collapsible_match)]` on by default [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 253 ~ Some(v) [INFO] [stdout] 254 ~ if !v.contains(&max_vertices) => { [INFO] [stdout] 255 | v.push(max_vertices); [INFO] [stdout] 256 ~ }, [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let` [INFO] [stdout] --> src/polygon_offsetting.rs:252:25 [INFO] [stdout] | [INFO] [stdout] 252 | / match indices.get_mut(&edge1.index) { [INFO] [stdout] 253 | | Some(v) => { [INFO] [stdout] 254 | | if !v.contains(&max_vertices) { [INFO] [stdout] 255 | | v.push(max_vertices); [INFO] [stdout] ... | [INFO] [stdout] 258 | | _ => {} [INFO] [stdout] 259 | | }; [INFO] [stdout] | |_________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match [INFO] [stdout] = note: `#[warn(clippy::single_match)]` on by default [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 252 ~ if let Some(v) = indices.get_mut(&edge1.index) { [INFO] [stdout] 253 + if !v.contains(&max_vertices) { [INFO] [stdout] 254 + v.push(max_vertices); [INFO] [stdout] 255 + } [INFO] [stdout] 256 ~ }; [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` can be collapsed into the outer `match` [INFO] [stdout] --> src/polygon_offsetting.rs:262:33 [INFO] [stdout] | [INFO] [stdout] 262 | / ... if !v.contains(&max_vertices) { [INFO] [stdout] 263 | | ... v.push(max_vertices); [INFO] [stdout] 264 | | ... } [INFO] [stdout] | |_______________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_match [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 261 ~ Some(v) [INFO] [stdout] 262 ~ if !v.contains(&max_vertices) => { [INFO] [stdout] 263 | v.push(max_vertices); [INFO] [stdout] 264 ~ }, [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let` [INFO] [stdout] --> src/polygon_offsetting.rs:260:25 [INFO] [stdout] | [INFO] [stdout] 260 | / match indices.get_mut(&edge2.index) { [INFO] [stdout] 261 | | Some(v) => { [INFO] [stdout] 262 | | if !v.contains(&max_vertices) { [INFO] [stdout] 263 | | v.push(max_vertices); [INFO] [stdout] ... | [INFO] [stdout] 266 | | _ => {} [INFO] [stdout] 267 | | }; [INFO] [stdout] | |_________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 260 ~ if let Some(v) = indices.get_mut(&edge2.index) { [INFO] [stdout] 261 + if !v.contains(&max_vertices) { [INFO] [stdout] 262 + v.push(max_vertices); [INFO] [stdout] 263 + } [INFO] [stdout] 264 ~ }; [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let` [INFO] [stdout] --> src/polygon_offsetting.rs:280:13 [INFO] [stdout] | [INFO] [stdout] 280 | / match indices.get(&idx) { [INFO] [stdout] 281 | | Some(cross) => { [INFO] [stdout] 282 | | if cross.len() > 0 { [INFO] [stdout] 283 | | let sorted_cross: Vec = self.sort_by_squared_dist(p1, &cross.to_vec(), &margin_polygon); [INFO] [stdout] ... | [INFO] [stdout] 312 | | _ => {} [INFO] [stdout] 313 | | } [INFO] [stdout] | |_____________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 280 ~ if let Some(cross) = indices.get(&idx) { [INFO] [stdout] 281 + if cross.len() > 0 { [INFO] [stdout] 282 + let sorted_cross: Vec = self.sort_by_squared_dist(p1, &cross.to_vec(), &margin_polygon); [INFO] [stdout] 283 + let new_edge: Edge = Edge { [INFO] [stdout] 284 + p1: edge.p1, [INFO] [stdout] 285 + p2: sorted_cross[0], [INFO] [stdout] 286 + index: 0, [INFO] [stdout] 287 + outward_normal: edge.outward_normal [INFO] [stdout] 288 + }; [INFO] [stdout] 289 + new_poly.push(new_edge); [INFO] [stdout] 290 + [INFO] [stdout] 291 + for i in 0..sorted_cross.len() - 1 { [INFO] [stdout] 292 + let new_edge: Edge = Edge { [INFO] [stdout] 293 + p1: sorted_cross[i], [INFO] [stdout] 294 + p2: sorted_cross[i + 1], [INFO] [stdout] 295 + index: 0, [INFO] [stdout] 296 + outward_normal: edge.outward_normal [INFO] [stdout] 297 + }; [INFO] [stdout] 298 + new_poly.push(new_edge); [INFO] [stdout] 299 + } [INFO] [stdout] 300 + let new_edge: Edge = Edge { [INFO] [stdout] 301 + p1: sorted_cross[sorted_cross.len() - 1], [INFO] [stdout] 302 + p2: edge.p2, [INFO] [stdout] 303 + index: 0, [INFO] [stdout] 304 + outward_normal: edge.outward_normal [INFO] [stdout] 305 + }; [INFO] [stdout] 306 + new_poly.push(new_edge); [INFO] [stdout] 307 + } else { [INFO] [stdout] 308 + new_poly.push(*edge); [INFO] [stdout] 309 + } [INFO] [stdout] 310 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/polygon_offsetting.rs:282:24 [INFO] [stdout] | [INFO] [stdout] 282 | if cross.len() > 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!cross.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/polygon_offsetting.rs:283:103 [INFO] [stdout] | [INFO] [stdout] 283 | let sorted_cross: Vec = self.sort_by_squared_dist(p1, &cross.to_vec(), &margin_polygon); [INFO] [stdout] | ^^^^^^^^^^^^^^^ help: change this to: `margin_polygon` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` can be collapsed into the outer `match` [INFO] [stdout] --> src/polygon_offsetting.rs:338:55 [INFO] [stdout] | [INFO] [stdout] 338 | match map.get_mut(&edge.p1) { Some(v) => {if !v.contains(&edge.index) {v.push(edge.index)}}, _ => {} }; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_match [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 338 - match map.get_mut(&edge.p1) { Some(v) => {if !v.contains(&edge.index) {v.push(edge.index)}}, _ => {} }; [INFO] [stdout] 338 + match map.get_mut(&edge.p1) { Some(v)if !v.contains(&edge.index) => {v.push(edge.index)}, _ => {} }; [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let` [INFO] [stdout] --> src/polygon_offsetting.rs:338:13 [INFO] [stdout] | [INFO] [stdout] 338 | match map.get_mut(&edge.p1) { Some(v) => {if !v.contains(&edge.index) {v.push(edge.index)}}, _ => {} }; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `if let Some(v) = map.get_mut(&edge.p1) {if !v.contains(&edge.index) {v.push(edge.index)}}` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/polygon_offsetting.rs:342:15 [INFO] [stdout] | [INFO] [stdout] 342 | while remaining.len() > 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!remaining.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/polygon_offsetting.rs:354:39 [INFO] [stdout] | [INFO] [stdout] 354 | while idx != start_idx || current_region.vertices.len() == 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `current_region.vertices.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `i` is used to index `contour` [INFO] [stdout] --> src/polygon_offsetting.rs:421:19 [INFO] [stdout] | [INFO] [stdout] 421 | for i in 0..contour.len() - 1 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_range_loop [INFO] [stdout] help: consider using an iterator and enumerate() [INFO] [stdout] | [INFO] [stdout] 421 - for i in 0..contour.len() - 1 { [INFO] [stdout] 421 + for (i, ) in contour.iter().enumerate().take(contour.len() - 1) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: field assignment outside of initializer for an instance created with Default::default() [INFO] [stdout] --> src/polygon_offsetting.rs:423:14 [INFO] [stdout] | [INFO] [stdout] 423 | vertex.is_intersect = false; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] note: consider initializing the variable with `polygon_offsetting::Vertex { is_intersect: false, x: contour[i].0, y: contour[i].1 }` and removing relevant reassignments [INFO] [stdout] --> src/polygon_offsetting.rs:422:14 [INFO] [stdout] | [INFO] [stdout] 422 | let mut vertex: Vertex = Vertex::default(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#field_reassign_with_default [INFO] [stdout] = note: `#[warn(clippy::field_reassign_with_default)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `i` is only used to index `edges` [INFO] [stdout] --> src/polygon_offsetting.rs:437:18 [INFO] [stdout] | [INFO] [stdout] 437 | for i in 0..edges.len() { [INFO] [stdout] | ^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_range_loop [INFO] [stdout] help: consider using an iterator [INFO] [stdout] | [INFO] [stdout] 437 - for i in 0..edges.len() { [INFO] [stdout] 437 + for in &edges { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/polygon_offsetting.rs:451:37 [INFO] [stdout] | [INFO] [stdout] 451 | fn tuples_to_segments(contour1: &Vec<(f64, f64)>) -> Vec { [INFO] [stdout] | ^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 451 - fn tuples_to_segments(contour1: &Vec<(f64, f64)>) -> Vec { [INFO] [stdout] 451 + fn tuples_to_segments(contour1: &[(f64, f64)]) -> Vec { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant field names in struct initialization [INFO] [stdout] --> src/polygon_offsetting.rs:119:31 [INFO] [stdout] | [INFO] [stdout] 119 | dots.push(Vertex {x: x, y: y, is_intersect: false}); [INFO] [stdout] | ^^^^ help: replace it with: `x` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_field_names [INFO] [stdout] = note: `#[warn(clippy::redundant_field_names)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/polygon_offsetting.rs:511:74 [INFO] [stdout] | [INFO] [stdout] 511 | let mut new_segments: Vec = Polygon::tuples_to_segments(&initial_contour); [INFO] [stdout] | ^^^^^^^^^^^^^^^^ help: change this to: `initial_contour` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `format!` [INFO] [stdout] --> src/polygon_offsetting.rs:517:24 [INFO] [stdout] | [INFO] [stdout] 517 | return Err(format!("Unclosed polygon").into()) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `"Unclosed polygon".to_string()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_format [INFO] [stdout] = note: `#[warn(clippy::useless_format)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant field names in struct initialization [INFO] [stdout] --> src/polygon_offsetting.rs:119:37 [INFO] [stdout] | [INFO] [stdout] 119 | dots.push(Vertex {x: x, y: y, is_intersect: false}); [INFO] [stdout] | ^^^^ help: replace it with: `y` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_field_names [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/draw_svg.rs:14:22 [INFO] [stdout] | [INFO] [stdout] 14 | initial_contour: &Vec<(f64, f64)>, [INFO] [stdout] | ^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 14 - initial_contour: &Vec<(f64, f64)>, [INFO] [stdout] 14 + initial_contour: &[(f64, f64)], [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `i` is used to index `segments` [INFO] [stdout] --> src/draw_svg.rs:59:14 [INFO] [stdout] | [INFO] [stdout] 59 | for i in 0..segments.len() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_range_loop [INFO] [stdout] help: consider using an iterator and enumerate() [INFO] [stdout] | [INFO] [stdout] 59 - for i in 0..segments.len() { [INFO] [stdout] 59 + for (i, ) in segments.iter().enumerate() { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: usage of a legacy numeric constant [INFO] [stdout] --> src/draw_svg.rs:78:26 [INFO] [stdout] | [INFO] [stdout] 78 | let mut max_x: f64 = std::f64::NEG_INFINITY; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#legacy_numeric_constants [INFO] [stdout] = note: `#[warn(clippy::legacy_numeric_constants)]` on by default [INFO] [stdout] help: use the associated constant instead [INFO] [stdout] | [INFO] [stdout] 78 - let mut max_x: f64 = std::f64::NEG_INFINITY; [INFO] [stdout] 78 + let mut max_x: f64 = f64::NEG_INFINITY; [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: usage of a legacy numeric constant [INFO] [stdout] --> src/draw_svg.rs:79:26 [INFO] [stdout] | [INFO] [stdout] 79 | let mut max_y: f64 = std::f64::NEG_INFINITY; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#legacy_numeric_constants [INFO] [stdout] help: use the associated constant instead [INFO] [stdout] | [INFO] [stdout] 79 - let mut max_y: f64 = std::f64::NEG_INFINITY; [INFO] [stdout] 79 + let mut max_y: f64 = f64::NEG_INFINITY; [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of an assign operation [INFO] [stdout] --> src/draw_svg.rs:94:9 [INFO] [stdout] | [INFO] [stdout] 94 | s.p1.0 = s.p1.0 / resize; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^ help: replace it with: `s.p1.0 /= resize` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#assign_op_pattern [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of an assign operation [INFO] [stdout] --> src/draw_svg.rs:95:9 [INFO] [stdout] | [INFO] [stdout] 95 | s.p1.1 = s.p1.1 / resize; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^ help: replace it with: `s.p1.1 /= resize` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#assign_op_pattern [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of an assign operation [INFO] [stdout] --> src/draw_svg.rs:96:9 [INFO] [stdout] | [INFO] [stdout] 96 | s.p2.0 = s.p2.0 / resize; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^ help: replace it with: `s.p2.0 /= resize` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#assign_op_pattern [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of an assign operation [INFO] [stdout] --> src/draw_svg.rs:97:9 [INFO] [stdout] | [INFO] [stdout] 97 | s.p2.1 = s.p2.1 / resize; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^ help: replace it with: `s.p2.1 /= resize` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#assign_op_pattern [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: usage of a legacy numeric constant [INFO] [stdout] --> src/draw_svg.rs:101:9 [INFO] [stdout] | [INFO] [stdout] 101 | std::f64::INFINITY, [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#legacy_numeric_constants [INFO] [stdout] help: use the associated constant instead [INFO] [stdout] | [INFO] [stdout] 101 - std::f64::INFINITY, [INFO] [stdout] 101 + f64::INFINITY, [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: usage of a legacy numeric constant [INFO] [stdout] --> src/draw_svg.rs:102:9 [INFO] [stdout] | [INFO] [stdout] 102 | std::f64::INFINITY, [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#legacy_numeric_constants [INFO] [stdout] help: use the associated constant instead [INFO] [stdout] | [INFO] [stdout] 102 - std::f64::INFINITY, [INFO] [stdout] 102 + f64::INFINITY, [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: usage of a legacy numeric constant [INFO] [stdout] --> src/draw_svg.rs:103:9 [INFO] [stdout] | [INFO] [stdout] 103 | std::f64::NEG_INFINITY, [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#legacy_numeric_constants [INFO] [stdout] help: use the associated constant instead [INFO] [stdout] | [INFO] [stdout] 103 - std::f64::NEG_INFINITY, [INFO] [stdout] 103 + f64::NEG_INFINITY, [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: usage of a legacy numeric constant [INFO] [stdout] --> src/draw_svg.rs:104:9 [INFO] [stdout] | [INFO] [stdout] 104 | std::f64::NEG_INFINITY [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#legacy_numeric_constants [INFO] [stdout] help: use the associated constant instead [INFO] [stdout] | [INFO] [stdout] 104 - std::f64::NEG_INFINITY [INFO] [stdout] 104 + f64::NEG_INFINITY [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: taken reference of right operand [INFO] [stdout] --> src/draw_svg.rs:146:16 [INFO] [stdout] | [INFO] [stdout] 146 | let dir = env_path.clone() + &dir_path; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^--------- [INFO] [stdout] | | [INFO] [stdout] | help: use the right value directly: `dir_path` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#op_ref [INFO] [stdout] = note: `#[warn(clippy::op_ref)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/draw_svg.rs:146:35 [INFO] [stdout] | [INFO] [stdout] 146 | let dir = env_path.clone() + &dir_path; [INFO] [stdout] | ^^^^^^^^^ help: change this to: `dir_path` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `map_err` over `inspect_err` [INFO] [stdout] --> src/draw_svg.rs:151:77 [INFO] [stdout] | [INFO] [stdout] 151 | let mut file = File::create(format!("{}.svg", dir.clone() + &filename)).map_err(|e| { [INFO] [stdout] | ^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_inspect [INFO] [stdout] = note: `#[warn(clippy::manual_inspect)]` on by default [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 151 ~ let mut file = File::create(format!("{}.svg", dir.clone() + &filename)).inspect_err(|e| { [INFO] [stdout] 152 ~ print!("Error on creating offset svg: {:?}", dir.clone() + &filename); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: taken reference of right operand [INFO] [stdout] --> src/draw_svg.rs:151:51 [INFO] [stdout] | [INFO] [stdout] 151 | let mut file = File::create(format!("{}.svg", dir.clone() + &filename)).map_err(|e| { [INFO] [stdout] | ^^^^^^^^^^^^^^--------- [INFO] [stdout] | | [INFO] [stdout] | help: use the right value directly: `filename` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#op_ref [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/draw_svg.rs:151:65 [INFO] [stdout] | [INFO] [stdout] 151 | let mut file = File::create(format!("{}.svg", dir.clone() + &filename)).map_err(|e| { [INFO] [stdout] | ^^^^^^^^^ help: change this to: `filename` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: taken reference of right operand [INFO] [stdout] --> src/draw_svg.rs:152:54 [INFO] [stdout] | [INFO] [stdout] 152 | print!("Error on creating offset svg: {:?}", dir.clone() + &filename); [INFO] [stdout] | ^^^^^^^^^^^^^^--------- [INFO] [stdout] | | [INFO] [stdout] | help: use the right value directly: `filename` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#op_ref [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/draw_svg.rs:152:68 [INFO] [stdout] | [INFO] [stdout] 152 | print!("Error on creating offset svg: {:?}", dir.clone() + &filename); [INFO] [stdout] | ^^^^^^^^^ help: change this to: `filename` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `vec!` [INFO] [stdout] --> src/draw_svg.rs:100:23 [INFO] [stdout] | [INFO] [stdout] 100 | let mut viewbox = vec![ [INFO] [stdout] | _______________________^ [INFO] [stdout] 101 | | std::f64::INFINITY, [INFO] [stdout] 102 | | std::f64::INFINITY, [INFO] [stdout] 103 | | std::f64::NEG_INFINITY, [INFO] [stdout] 104 | | std::f64::NEG_INFINITY [INFO] [stdout] 105 | | ]; [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_vec [INFO] [stdout] = note: `#[warn(clippy::useless_vec)]` on by default [INFO] [stdout] help: you can use an array directly [INFO] [stdout] | [INFO] [stdout] 100 ~ let mut viewbox = [std::f64::INFINITY, [INFO] [stdout] 101 + std::f64::INFINITY, [INFO] [stdout] 102 + std::f64::NEG_INFINITY, [INFO] [stdout] 103 ~ std::f64::NEG_INFINITY]; [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/polygon_offsetting.rs:39:27 [INFO] [stdout] | [INFO] [stdout] 39 | fn compute_area(contours: &Vec<(f64, f64)>) -> f64 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] = note: `#[warn(clippy::ptr_arg)]` on by default [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 39 - fn compute_area(contours: &Vec<(f64, f64)>) -> f64 { [INFO] [stdout] 39 + fn compute_area(contours: &[(f64, f64)]) -> f64 { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/polygon_offsetting.rs:41:8 [INFO] [stdout] | [INFO] [stdout] 41 | if contours.len() == 0 { return 0.0 } [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `contours.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero [INFO] [stdout] = note: `#[warn(clippy::len_zero)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/polygon_offsetting.rs:48:33 [INFO] [stdout] | [INFO] [stdout] 48 | fn compute_perimeter(contour2d: &Vec<(f64, f64)>) -> f64 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 48 - fn compute_perimeter(contour2d: &Vec<(f64, f64)>) -> f64 { [INFO] [stdout] 48 + fn compute_perimeter(contour2d: &[(f64, f64)]) -> f64 { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/polygon_offsetting.rs:74:28 [INFO] [stdout] | [INFO] [stdout] 74 | fn reverse_segments(sgmts: &Vec) -> Vec { [INFO] [stdout] | ^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 74 - fn reverse_segments(sgmts: &Vec) -> Vec { [INFO] [stdout] 74 + fn reverse_segments(sgmts: &[Segment]) -> Vec { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of an assign operation [INFO] [stdout] --> src/polygon_offsetting.rs:93:32 [INFO] [stdout] | [INFO] [stdout] 93 | if start_angle < 0. { start_angle = 2. * std::f64::consts::PI + start_angle } [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace it with: `start_angle += 2. * std::f64::consts::PI` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#assign_op_pattern [INFO] [stdout] = note: `#[warn(clippy::assign_op_pattern)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of an assign operation [INFO] [stdout] --> src/polygon_offsetting.rs:94:32 [INFO] [stdout] | [INFO] [stdout] 94 | if end_angle <= 0. { end_angle = 2. * std::f64::consts::PI + end_angle } [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace it with: `end_angle += 2. * std::f64::consts::PI` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#assign_op_pattern [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: returning the result of a `let` binding from a block [INFO] [stdout] --> src/polygon_offsetting.rs:142:9 [INFO] [stdout] | [INFO] [stdout] 137 | / let v_cross = Some(Vertex { [INFO] [stdout] 138 | | x: e1.0.x + ua * (e1.1.x - e1.0.x), [INFO] [stdout] 139 | | y: e1.0.y + ua * (e1.1.y - e1.0.y), [INFO] [stdout] 140 | | is_intersect: is_inters [INFO] [stdout] 141 | | }); [INFO] [stdout] | |___________- unnecessary `let` binding [INFO] [stdout] 142 | v_cross [INFO] [stdout] | ^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#let_and_return [INFO] [stdout] = note: `#[warn(clippy::let_and_return)]` on by default [INFO] [stdout] help: return the expression directly [INFO] [stdout] | [INFO] [stdout] 137 ~ [INFO] [stdout] 138 ~ Some(Vertex { [INFO] [stdout] 139 + x: e1.0.x + ua * (e1.1.x - e1.0.x), [INFO] [stdout] 140 + y: e1.0.y + ua * (e1.1.y - e1.0.y), [INFO] [stdout] 141 + is_intersect: is_inters [INFO] [stdout] 142 + }) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `unwrap` on `vertex` after checking its variant with `is_none` [INFO] [stdout] --> src/polygon_offsetting.rs:188:40 [INFO] [stdout] | [INFO] [stdout] 176 | if vertex.is_none() { [INFO] [stdout] | ------------------- help: try: `if let Some() = vertex` [INFO] [stdout] ... [INFO] [stdout] 188 | vertices.insert(index, vertex.unwrap()); [INFO] [stdout] | ^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_unwrap [INFO] [stdout] = note: `#[warn(clippy::unnecessary_unwrap)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: returning the result of a `let` binding from a block [INFO] [stdout] --> src/polygon_offsetting.rs:195:9 [INFO] [stdout] | [INFO] [stdout] 194 | let margin_polygon = self.create_polygon(vertices, self.offset_margin, false); [INFO] [stdout] | ------------------------------------------------------------------------------ unnecessary `let` binding [INFO] [stdout] 195 | margin_polygon [INFO] [stdout] | ^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#let_and_return [INFO] [stdout] help: return the expression directly [INFO] [stdout] | [INFO] [stdout] 194 ~ [INFO] [stdout] 195 ~ self.create_polygon(vertices, self.offset_margin, false) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/polygon_offsetting.rs:204:54 [INFO] [stdout] | [INFO] [stdout] 204 | cross_coord.push((*c, *poly.vertices.get(&c).unwrap())); [INFO] [stdout] | ^^ help: change this to: `c` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] = note: `#[warn(clippy::needless_borrow)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `i` is only used to index `cross_coord` [INFO] [stdout] --> src/polygon_offsetting.rs:207:18 [INFO] [stdout] | [INFO] [stdout] 207 | for i in 0..cross_coord.len() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_range_loop [INFO] [stdout] = note: `#[warn(clippy::needless_range_loop)]` on by default [INFO] [stdout] help: consider using an iterator [INFO] [stdout] | [INFO] [stdout] 207 - for i in 0..cross_coord.len() { [INFO] [stdout] 207 + for in &cross_coord { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this boolean expression can be simplified [INFO] [stdout] --> src/polygon_offsetting.rs:248:24 [INFO] [stdout] | [INFO] [stdout] 248 | if !inters.is_none() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ help: try: `inters.is_some()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#nonminimal_bool [INFO] [stdout] = note: `#[warn(clippy::nonminimal_bool)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `unwrap` on `inters` after checking its variant with `is_none` [INFO] [stdout] --> src/polygon_offsetting.rs:249:59 [INFO] [stdout] | [INFO] [stdout] 248 | if !inters.is_none() { [INFO] [stdout] | ---------------- the check is happening here [INFO] [stdout] 249 | vertices.insert(max_vertices + 1, inters.unwrap()); [INFO] [stdout] | ^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: try using `match` [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_unwrap [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` can be collapsed into the outer `match` [INFO] [stdout] --> src/polygon_offsetting.rs:254:33 [INFO] [stdout] | [INFO] [stdout] 254 | / ... if !v.contains(&max_vertices) { [INFO] [stdout] 255 | | ... v.push(max_vertices); [INFO] [stdout] 256 | | ... } [INFO] [stdout] | |_______________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_match [INFO] [stdout] = note: `#[warn(clippy::collapsible_match)]` on by default [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 253 ~ Some(v) [INFO] [stdout] 254 ~ if !v.contains(&max_vertices) => { [INFO] [stdout] 255 | v.push(max_vertices); [INFO] [stdout] 256 ~ }, [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let` [INFO] [stdout] --> src/polygon_offsetting.rs:252:25 [INFO] [stdout] | [INFO] [stdout] 252 | / match indices.get_mut(&edge1.index) { [INFO] [stdout] 253 | | Some(v) => { [INFO] [stdout] 254 | | if !v.contains(&max_vertices) { [INFO] [stdout] 255 | | v.push(max_vertices); [INFO] [stdout] ... | [INFO] [stdout] 258 | | _ => {} [INFO] [stdout] 259 | | }; [INFO] [stdout] | |_________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match [INFO] [stdout] = note: `#[warn(clippy::single_match)]` on by default [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 252 ~ if let Some(v) = indices.get_mut(&edge1.index) { [INFO] [stdout] 253 + if !v.contains(&max_vertices) { [INFO] [stdout] 254 + v.push(max_vertices); [INFO] [stdout] 255 + } [INFO] [stdout] 256 ~ }; [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` can be collapsed into the outer `match` [INFO] [stdout] --> src/polygon_offsetting.rs:262:33 [INFO] [stdout] | [INFO] [stdout] 262 | / ... if !v.contains(&max_vertices) { [INFO] [stdout] 263 | | ... v.push(max_vertices); [INFO] [stdout] 264 | | ... } [INFO] [stdout] | |_______________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_match [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 261 ~ Some(v) [INFO] [stdout] 262 ~ if !v.contains(&max_vertices) => { [INFO] [stdout] 263 | v.push(max_vertices); [INFO] [stdout] 264 ~ }, [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let` [INFO] [stdout] --> src/polygon_offsetting.rs:260:25 [INFO] [stdout] | [INFO] [stdout] 260 | / match indices.get_mut(&edge2.index) { [INFO] [stdout] 261 | | Some(v) => { [INFO] [stdout] 262 | | if !v.contains(&max_vertices) { [INFO] [stdout] 263 | | v.push(max_vertices); [INFO] [stdout] ... | [INFO] [stdout] 266 | | _ => {} [INFO] [stdout] 267 | | }; [INFO] [stdout] | |_________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 260 ~ if let Some(v) = indices.get_mut(&edge2.index) { [INFO] [stdout] 261 + if !v.contains(&max_vertices) { [INFO] [stdout] 262 + v.push(max_vertices); [INFO] [stdout] 263 + } [INFO] [stdout] 264 ~ }; [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let` [INFO] [stdout] --> src/polygon_offsetting.rs:280:13 [INFO] [stdout] | [INFO] [stdout] 280 | / match indices.get(&idx) { [INFO] [stdout] 281 | | Some(cross) => { [INFO] [stdout] 282 | | if cross.len() > 0 { [INFO] [stdout] 283 | | let sorted_cross: Vec = self.sort_by_squared_dist(p1, &cross.to_vec(), &margin_polygon); [INFO] [stdout] ... | [INFO] [stdout] 312 | | _ => {} [INFO] [stdout] 313 | | } [INFO] [stdout] | |_____________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 280 ~ if let Some(cross) = indices.get(&idx) { [INFO] [stdout] 281 + if cross.len() > 0 { [INFO] [stdout] 282 + let sorted_cross: Vec = self.sort_by_squared_dist(p1, &cross.to_vec(), &margin_polygon); [INFO] [stdout] 283 + let new_edge: Edge = Edge { [INFO] [stdout] 284 + p1: edge.p1, [INFO] [stdout] 285 + p2: sorted_cross[0], [INFO] [stdout] 286 + index: 0, [INFO] [stdout] 287 + outward_normal: edge.outward_normal [INFO] [stdout] 288 + }; [INFO] [stdout] 289 + new_poly.push(new_edge); [INFO] [stdout] 290 + [INFO] [stdout] 291 + for i in 0..sorted_cross.len() - 1 { [INFO] [stdout] 292 + let new_edge: Edge = Edge { [INFO] [stdout] 293 + p1: sorted_cross[i], [INFO] [stdout] 294 + p2: sorted_cross[i + 1], [INFO] [stdout] 295 + index: 0, [INFO] [stdout] 296 + outward_normal: edge.outward_normal [INFO] [stdout] 297 + }; [INFO] [stdout] 298 + new_poly.push(new_edge); [INFO] [stdout] 299 + } [INFO] [stdout] 300 + let new_edge: Edge = Edge { [INFO] [stdout] 301 + p1: sorted_cross[sorted_cross.len() - 1], [INFO] [stdout] 302 + p2: edge.p2, [INFO] [stdout] 303 + index: 0, [INFO] [stdout] 304 + outward_normal: edge.outward_normal [INFO] [stdout] 305 + }; [INFO] [stdout] 306 + new_poly.push(new_edge); [INFO] [stdout] 307 + } else { [INFO] [stdout] 308 + new_poly.push(*edge); [INFO] [stdout] 309 + } [INFO] [stdout] 310 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/polygon_offsetting.rs:282:24 [INFO] [stdout] | [INFO] [stdout] 282 | if cross.len() > 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!cross.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/polygon_offsetting.rs:283:103 [INFO] [stdout] | [INFO] [stdout] 283 | let sorted_cross: Vec = self.sort_by_squared_dist(p1, &cross.to_vec(), &margin_polygon); [INFO] [stdout] | ^^^^^^^^^^^^^^^ help: change this to: `margin_polygon` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` can be collapsed into the outer `match` [INFO] [stdout] --> src/polygon_offsetting.rs:338:55 [INFO] [stdout] | [INFO] [stdout] 338 | match map.get_mut(&edge.p1) { Some(v) => {if !v.contains(&edge.index) {v.push(edge.index)}}, _ => {} }; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_match [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 338 - match map.get_mut(&edge.p1) { Some(v) => {if !v.contains(&edge.index) {v.push(edge.index)}}, _ => {} }; [INFO] [stdout] 338 + match map.get_mut(&edge.p1) { Some(v)if !v.contains(&edge.index) => {v.push(edge.index)}, _ => {} }; [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let` [INFO] [stdout] --> src/polygon_offsetting.rs:338:13 [INFO] [stdout] | [INFO] [stdout] 338 | match map.get_mut(&edge.p1) { Some(v) => {if !v.contains(&edge.index) {v.push(edge.index)}}, _ => {} }; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `if let Some(v) = map.get_mut(&edge.p1) {if !v.contains(&edge.index) {v.push(edge.index)}}` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/polygon_offsetting.rs:342:15 [INFO] [stdout] | [INFO] [stdout] 342 | while remaining.len() > 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!remaining.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/polygon_offsetting.rs:354:39 [INFO] [stdout] | [INFO] [stdout] 354 | while idx != start_idx || current_region.vertices.len() == 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `current_region.vertices.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `i` is used to index `contour` [INFO] [stdout] --> src/polygon_offsetting.rs:421:19 [INFO] [stdout] | [INFO] [stdout] 421 | for i in 0..contour.len() - 1 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_range_loop [INFO] [stdout] help: consider using an iterator and enumerate() [INFO] [stdout] | [INFO] [stdout] 421 - for i in 0..contour.len() - 1 { [INFO] [stdout] 421 + for (i, ) in contour.iter().enumerate().take(contour.len() - 1) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: field assignment outside of initializer for an instance created with Default::default() [INFO] [stdout] --> src/polygon_offsetting.rs:423:14 [INFO] [stdout] | [INFO] [stdout] 423 | vertex.is_intersect = false; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] note: consider initializing the variable with `polygon_offsetting::Vertex { is_intersect: false, x: contour[i].0, y: contour[i].1 }` and removing relevant reassignments [INFO] [stdout] --> src/polygon_offsetting.rs:422:14 [INFO] [stdout] | [INFO] [stdout] 422 | let mut vertex: Vertex = Vertex::default(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#field_reassign_with_default [INFO] [stdout] = note: `#[warn(clippy::field_reassign_with_default)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `i` is only used to index `edges` [INFO] [stdout] --> src/polygon_offsetting.rs:437:18 [INFO] [stdout] | [INFO] [stdout] 437 | for i in 0..edges.len() { [INFO] [stdout] | ^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_range_loop [INFO] [stdout] help: consider using an iterator [INFO] [stdout] | [INFO] [stdout] 437 - for i in 0..edges.len() { [INFO] [stdout] 437 + for in &edges { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/polygon_offsetting.rs:451:37 [INFO] [stdout] | [INFO] [stdout] 451 | fn tuples_to_segments(contour1: &Vec<(f64, f64)>) -> Vec { [INFO] [stdout] | ^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 451 - fn tuples_to_segments(contour1: &Vec<(f64, f64)>) -> Vec { [INFO] [stdout] 451 + fn tuples_to_segments(contour1: &[(f64, f64)]) -> Vec { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/polygon_offsetting.rs:511:74 [INFO] [stdout] | [INFO] [stdout] 511 | let mut new_segments: Vec = Polygon::tuples_to_segments(&initial_contour); [INFO] [stdout] | ^^^^^^^^^^^^^^^^ help: change this to: `initial_contour` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `format!` [INFO] [stdout] --> src/polygon_offsetting.rs:517:24 [INFO] [stdout] | [INFO] [stdout] 517 | return Err(format!("Unclosed polygon").into()) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `"Unclosed polygon".to_string()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_format [INFO] [stdout] = note: `#[warn(clippy::useless_format)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unnecessary map of the identity function [INFO] [stdout] --> examples/example_offsetting.rs:42:54 [INFO] [stdout] | [INFO] [stdout] 42 | let mut polygon = Polygon::new(&points, offset_size).map_err(|e| { e })?; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^ help: remove the call to `map_err` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#map_identity [INFO] [stdout] = note: `#[warn(clippy::map_identity)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unnecessary map of the identity function [INFO] [stdout] --> examples/example_offsetting.rs:43:52 [INFO] [stdout] | [INFO] [stdout] 43 | let offset: Offset = polygon.offsetting(tolerance).map_err(|e| { e })?; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^ help: remove the call to `map_err` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#map_identity [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/draw_svg.rs:14:22 [INFO] [stdout] | [INFO] [stdout] 14 | initial_contour: &Vec<(f64, f64)>, [INFO] [stdout] | ^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 14 - initial_contour: &Vec<(f64, f64)>, [INFO] [stdout] 14 + initial_contour: &[(f64, f64)], [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `i` is used to index `segments` [INFO] [stdout] --> src/draw_svg.rs:59:14 [INFO] [stdout] | [INFO] [stdout] 59 | for i in 0..segments.len() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_range_loop [INFO] [stdout] help: consider using an iterator and enumerate() [INFO] [stdout] | [INFO] [stdout] 59 - for i in 0..segments.len() { [INFO] [stdout] 59 + for (i, ) in segments.iter().enumerate() { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: usage of a legacy numeric constant [INFO] [stdout] --> src/draw_svg.rs:78:26 [INFO] [stdout] | [INFO] [stdout] 78 | let mut max_x: f64 = std::f64::NEG_INFINITY; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#legacy_numeric_constants [INFO] [stdout] = note: `#[warn(clippy::legacy_numeric_constants)]` on by default [INFO] [stdout] help: use the associated constant instead [INFO] [stdout] | [INFO] [stdout] 78 - let mut max_x: f64 = std::f64::NEG_INFINITY; [INFO] [stdout] 78 + let mut max_x: f64 = f64::NEG_INFINITY; [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: usage of a legacy numeric constant [INFO] [stdout] --> src/draw_svg.rs:79:26 [INFO] [stdout] | [INFO] [stdout] 79 | let mut max_y: f64 = std::f64::NEG_INFINITY; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#legacy_numeric_constants [INFO] [stdout] help: use the associated constant instead [INFO] [stdout] | [INFO] [stdout] 79 - let mut max_y: f64 = std::f64::NEG_INFINITY; [INFO] [stdout] 79 + let mut max_y: f64 = f64::NEG_INFINITY; [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of an assign operation [INFO] [stdout] --> src/draw_svg.rs:94:9 [INFO] [stdout] | [INFO] [stdout] 94 | s.p1.0 = s.p1.0 / resize; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^ help: replace it with: `s.p1.0 /= resize` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#assign_op_pattern [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of an assign operation [INFO] [stdout] --> src/draw_svg.rs:95:9 [INFO] [stdout] | [INFO] [stdout] 95 | s.p1.1 = s.p1.1 / resize; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^ help: replace it with: `s.p1.1 /= resize` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#assign_op_pattern [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of an assign operation [INFO] [stdout] --> src/draw_svg.rs:96:9 [INFO] [stdout] | [INFO] [stdout] 96 | s.p2.0 = s.p2.0 / resize; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^ help: replace it with: `s.p2.0 /= resize` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#assign_op_pattern [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of an assign operation [INFO] [stdout] --> src/draw_svg.rs:97:9 [INFO] [stdout] | [INFO] [stdout] 97 | s.p2.1 = s.p2.1 / resize; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^ help: replace it with: `s.p2.1 /= resize` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#assign_op_pattern [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: usage of a legacy numeric constant [INFO] [stdout] --> src/draw_svg.rs:101:9 [INFO] [stdout] | [INFO] [stdout] 101 | std::f64::INFINITY, [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#legacy_numeric_constants [INFO] [stdout] help: use the associated constant instead [INFO] [stdout] | [INFO] [stdout] 101 - std::f64::INFINITY, [INFO] [stdout] 101 + f64::INFINITY, [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: usage of a legacy numeric constant [INFO] [stdout] --> src/draw_svg.rs:102:9 [INFO] [stdout] | [INFO] [stdout] 102 | std::f64::INFINITY, [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#legacy_numeric_constants [INFO] [stdout] help: use the associated constant instead [INFO] [stdout] | [INFO] [stdout] 102 - std::f64::INFINITY, [INFO] [stdout] 102 + f64::INFINITY, [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: usage of a legacy numeric constant [INFO] [stdout] --> src/draw_svg.rs:103:9 [INFO] [stdout] | [INFO] [stdout] 103 | std::f64::NEG_INFINITY, [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#legacy_numeric_constants [INFO] [stdout] help: use the associated constant instead [INFO] [stdout] | [INFO] [stdout] 103 - std::f64::NEG_INFINITY, [INFO] [stdout] 103 + f64::NEG_INFINITY, [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: usage of a legacy numeric constant [INFO] [stdout] --> src/draw_svg.rs:104:9 [INFO] [stdout] | [INFO] [stdout] 104 | std::f64::NEG_INFINITY [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#legacy_numeric_constants [INFO] [stdout] help: use the associated constant instead [INFO] [stdout] | [INFO] [stdout] 104 - std::f64::NEG_INFINITY [INFO] [stdout] 104 + f64::NEG_INFINITY [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: taken reference of right operand [INFO] [stdout] --> src/draw_svg.rs:146:16 [INFO] [stdout] | [INFO] [stdout] 146 | let dir = env_path.clone() + &dir_path; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^--------- [INFO] [stdout] | | [INFO] [stdout] | help: use the right value directly: `dir_path` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#op_ref [INFO] [stdout] = note: `#[warn(clippy::op_ref)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/draw_svg.rs:146:35 [INFO] [stdout] | [INFO] [stdout] 146 | let dir = env_path.clone() + &dir_path; [INFO] [stdout] | ^^^^^^^^^ help: change this to: `dir_path` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `map_err` over `inspect_err` [INFO] [stdout] --> src/draw_svg.rs:151:77 [INFO] [stdout] | [INFO] [stdout] 151 | let mut file = File::create(format!("{}.svg", dir.clone() + &filename)).map_err(|e| { [INFO] [stdout] | ^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_inspect [INFO] [stdout] = note: `#[warn(clippy::manual_inspect)]` on by default [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 151 ~ let mut file = File::create(format!("{}.svg", dir.clone() + &filename)).inspect_err(|e| { [INFO] [stdout] 152 ~ print!("Error on creating offset svg: {:?}", dir.clone() + &filename); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: taken reference of right operand [INFO] [stdout] --> src/draw_svg.rs:151:51 [INFO] [stdout] | [INFO] [stdout] 151 | let mut file = File::create(format!("{}.svg", dir.clone() + &filename)).map_err(|e| { [INFO] [stdout] | ^^^^^^^^^^^^^^--------- [INFO] [stdout] | | [INFO] [stdout] | help: use the right value directly: `filename` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#op_ref [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/draw_svg.rs:151:65 [INFO] [stdout] | [INFO] [stdout] 151 | let mut file = File::create(format!("{}.svg", dir.clone() + &filename)).map_err(|e| { [INFO] [stdout] | ^^^^^^^^^ help: change this to: `filename` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: taken reference of right operand [INFO] [stdout] --> src/draw_svg.rs:152:54 [INFO] [stdout] | [INFO] [stdout] 152 | print!("Error on creating offset svg: {:?}", dir.clone() + &filename); [INFO] [stdout] | ^^^^^^^^^^^^^^--------- [INFO] [stdout] | | [INFO] [stdout] | help: use the right value directly: `filename` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#op_ref [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/draw_svg.rs:152:68 [INFO] [stdout] | [INFO] [stdout] 152 | print!("Error on creating offset svg: {:?}", dir.clone() + &filename); [INFO] [stdout] | ^^^^^^^^^ help: change this to: `filename` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `vec!` [INFO] [stdout] --> src/draw_svg.rs:100:23 [INFO] [stdout] | [INFO] [stdout] 100 | let mut viewbox = vec![ [INFO] [stdout] | _______________________^ [INFO] [stdout] 101 | | std::f64::INFINITY, [INFO] [stdout] 102 | | std::f64::INFINITY, [INFO] [stdout] 103 | | std::f64::NEG_INFINITY, [INFO] [stdout] 104 | | std::f64::NEG_INFINITY [INFO] [stdout] 105 | | ]; [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_vec [INFO] [stdout] = note: `#[warn(clippy::useless_vec)]` on by default [INFO] [stdout] help: you can use an array directly [INFO] [stdout] | [INFO] [stdout] 100 ~ let mut viewbox = [std::f64::INFINITY, [INFO] [stdout] 101 + std::f64::INFINITY, [INFO] [stdout] 102 + std::f64::NEG_INFINITY, [INFO] [stdout] 103 ~ std::f64::NEG_INFINITY]; [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stderr] Finished `dev` profile [unoptimized + debuginfo] target(s) in 0.48s [INFO] running `Command { std: "docker" "inspect" "177df172a92458e602d9f043100f59ba98faac0efd6ee76c8178c8e5a880159a", kill_on_drop: false }` [INFO] running `Command { std: "docker" "rm" "-f" "177df172a92458e602d9f043100f59ba98faac0efd6ee76c8178c8e5a880159a", kill_on_drop: false }` [INFO] [stdout] 177df172a92458e602d9f043100f59ba98faac0efd6ee76c8178c8e5a880159a