Skip to content

Commit 4344f28

Browse files
0HyperCubeKeavon
andauthored
Reduce development environment warnings and remove DWARF debug symbols (#2741)
* Ignore tauri gen * Deny warnings on CI * Fix all warnings in current nightly rustc * Disable DWARF debug info for development builds * Fix typo --------- Co-authored-by: Keavon Chambers <keavon@keavon.com>
1 parent 8e5abf6 commit 4344f28

22 files changed

Lines changed: 53 additions & 7968 deletions

File tree

.github/workflows/build-dev-and-ci.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,8 @@ jobs:
8484
mold -run cargo fmt --all -- --check
8585
8686
- name: 🦀 Build Rust code
87+
env:
88+
RUSTFLAGS: -Dwarnings
8789
run: |
8890
mold -run cargo build --all-features
8991

editor/src/messages/portfolio/document/document_message.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,8 @@ use graphene_std::transform::Footprint;
1616
use graphene_std::vector::style::ViewMode;
1717

1818
#[impl_message(Message, PortfolioMessage, Document)]
19-
#[derive(PartialEq, Clone, Debug, serde::Serialize, serde::Deserialize)]
19+
#[derive(derivative::Derivative, Clone, serde::Serialize, serde::Deserialize)]
20+
#[derivative(Debug, PartialEq)]
2021
pub enum DocumentMessage {
2122
Noop,
2223
// Sub-messages
@@ -157,6 +158,7 @@ pub enum DocumentMessage {
157158
},
158159
SetSnapping {
159160
#[serde(skip)]
161+
#[derivative(Debug = "ignore", PartialEq = "ignore")]
160162
closure: Option<for<'a> fn(&'a mut SnappingState) -> &'a mut bool>,
161163
snapping_state: bool,
162164
},

editor/src/messages/portfolio/document/overlays/overlays_message.rs

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,19 @@ use super::utility_types::{OverlayProvider, empty_provider};
22
use crate::messages::prelude::*;
33

44
#[impl_message(Message, DocumentMessage, Overlays)]
5-
#[derive(PartialEq, Clone, Debug, serde::Serialize, serde::Deserialize)]
5+
#[derive(derivative::Derivative, Clone, serde::Serialize, serde::Deserialize)]
6+
#[derivative(Debug, PartialEq)]
67
pub enum OverlaysMessage {
78
Draw,
89
// Serde functionality isn't used but is required by the message system macros
9-
AddProvider(#[serde(skip, default = "empty_provider")] OverlayProvider),
10-
RemoveProvider(#[serde(skip, default = "empty_provider")] OverlayProvider),
10+
AddProvider(
11+
#[serde(skip, default = "empty_provider")]
12+
#[derivative(Debug = "ignore", PartialEq = "ignore")]
13+
OverlayProvider,
14+
),
15+
RemoveProvider(
16+
#[serde(skip, default = "empty_provider")]
17+
#[derivative(Debug = "ignore", PartialEq = "ignore")]
18+
OverlayProvider,
19+
),
1120
}

editor/src/messages/portfolio/document/utility_types/document_metadata.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -294,15 +294,15 @@ impl LayerNodeIdentifier {
294294
}
295295

296296
/// Iterator over all direct children (excluding self and recursive children)
297-
pub fn children(self, metadata: &DocumentMetadata) -> AxisIter {
297+
pub fn children(self, metadata: &DocumentMetadata) -> AxisIter<'_> {
298298
AxisIter {
299299
layer_node: self.first_child(metadata),
300300
next_node: Self::next_sibling,
301301
metadata,
302302
}
303303
}
304304

305-
pub fn downstream_siblings(self, metadata: &DocumentMetadata) -> AxisIter {
305+
pub fn downstream_siblings(self, metadata: &DocumentMetadata) -> AxisIter<'_> {
306306
AxisIter {
307307
layer_node: Some(self),
308308
next_node: Self::previous_sibling,
@@ -311,7 +311,7 @@ impl LayerNodeIdentifier {
311311
}
312312

313313
/// All ancestors of this layer, including self, going to the document root
314-
pub fn ancestors(self, metadata: &DocumentMetadata) -> AxisIter {
314+
pub fn ancestors(self, metadata: &DocumentMetadata) -> AxisIter<'_> {
315315
AxisIter {
316316
layer_node: Some(self),
317317
next_node: Self::parent,
@@ -320,7 +320,7 @@ impl LayerNodeIdentifier {
320320
}
321321

322322
/// Iterator through all the last children, starting from self
323-
pub fn last_children(self, metadata: &DocumentMetadata) -> AxisIter {
323+
pub fn last_children(self, metadata: &DocumentMetadata) -> AxisIter<'_> {
324324
AxisIter {
325325
layer_node: Some(self),
326326
next_node: Self::last_child,
@@ -329,7 +329,7 @@ impl LayerNodeIdentifier {
329329
}
330330

331331
/// Iterator through all descendants, including recursive children (not including self)
332-
pub fn descendants(self, metadata: &DocumentMetadata) -> DescendantsIter {
332+
pub fn descendants(self, metadata: &DocumentMetadata) -> DescendantsIter<'_> {
333333
DescendantsIter {
334334
front: self.first_child(metadata),
335335
back: self.last_child(metadata).and_then(|child| child.last_children(metadata).last()),

editor/src/messages/tool/common_functionality/transformation_cage.rs

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -578,15 +578,19 @@ impl BoundingBoxManager {
578578
category,
579579
TransformCageSizeCategory::Full | TransformCageSizeCategory::Narrow | TransformCageSizeCategory::ReducedLandscape
580580
) {
581-
horizontal_edges.map(|point| draw_handle(point, horizontal_angle));
581+
for point in horizontal_edges {
582+
draw_handle(point, horizontal_angle);
583+
}
582584
}
583585

584586
// Draw the vertical midpoint drag handles
585587
if matches!(
586588
category,
587589
TransformCageSizeCategory::Full | TransformCageSizeCategory::Narrow | TransformCageSizeCategory::ReducedPortrait
588590
) {
589-
vertical_edges.map(|point| draw_handle(point, vertical_angle));
591+
for point in vertical_edges {
592+
draw_handle(point, vertical_angle);
593+
}
590594
}
591595

592596
let angle = quad
@@ -601,7 +605,9 @@ impl BoundingBoxManager {
601605
category,
602606
TransformCageSizeCategory::Full | TransformCageSizeCategory::ReducedBoth | TransformCageSizeCategory::ReducedLandscape | TransformCageSizeCategory::ReducedPortrait
603607
) {
604-
quad.0.map(|point| draw_handle(point, angle));
608+
for point in quad.0 {
609+
draw_handle(point, angle);
610+
}
605611
}
606612

607613
// Draw the flat line endpoint drag handles

frontend/src-tauri/.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
11
# Generated by Cargo
22
# will have compiled files and executables
33
/target/
4+
# Generated by tauri
5+
gen/

frontend/src-tauri/gen/schemas/acl-manifests.json

Lines changed: 0 additions & 1 deletion
This file was deleted.

frontend/src-tauri/gen/schemas/capabilities.json

Lines changed: 0 additions & 1 deletion
This file was deleted.

0 commit comments

Comments
 (0)