Skip to content

Commit a7e3826

Browse files
Enable workspace lint configuration, fix lints (#19)
1 parent b84f1e6 commit a7e3826

File tree

8 files changed

+27
-11
lines changed

8 files changed

+27
-11
lines changed

Cargo.toml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,10 @@ version = "0.3.0"
88
license = "Apache-2.0 OR MIT"
99
repository = "https://github.com/linebender/vello_svg"
1010

11+
[workspace.lints]
12+
clippy.doc_markdown = "warn"
13+
clippy.semicolon_if_nothing_returned = "warn"
14+
1115
[workspace.dependencies]
1216
# NOTE: Make sure to keep this in sync with the version badge in README.md
1317
vello = { version = "0.2.0", default-features = false }
@@ -22,6 +26,9 @@ license.workspace = true
2226
edition.workspace = true
2327
repository.workspace = true
2428

29+
[lints]
30+
workspace = true
31+
2532
[dependencies]
2633
vello = { workspace = true }
2734
thiserror = "1.0.61"

examples/run_wasm/Cargo.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,8 @@ license.workspace = true
55
repository.workspace = true
66
publish = false
77

8+
[lints]
9+
workspace = true
10+
811
[dependencies]
912
cargo-run-wasm = "0.4.0"

examples/scenes/Cargo.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@ license.workspace = true
66
repository.workspace = true
77
publish = false
88

9+
[lints]
10+
workspace = true
11+
912
[dependencies]
1013
vello = { workspace = true }
1114
vello_svg = { path = "../.." }

examples/with_winit/Cargo.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,9 @@ crate-type = ["cdylib", "lib"]
1616
name = "with_winit_bin"
1717
path = "src/main.rs"
1818

19+
[lints]
20+
workspace = true
21+
1922
[dependencies]
2023
vello = { workspace = true, features = ["buffer_labels", "wgpu"] }
2124
scenes = { path = "../scenes" }

examples/with_winit/src/lib.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -158,14 +158,14 @@ fn run(
158158
if event.state == ElementState::Pressed {
159159
match event.logical_key.as_ref() {
160160
Key::Named(NamedKey::ArrowLeft) => {
161-
scene_ix = scene_ix.saturating_sub(1)
161+
scene_ix = scene_ix.saturating_sub(1);
162162
}
163163
Key::Named(NamedKey::ArrowRight) => {
164-
scene_ix = scene_ix.saturating_add(1)
164+
scene_ix = scene_ix.saturating_add(1);
165165
}
166166
Key::Named(NamedKey::ArrowUp) => complexity += 1,
167167
Key::Named(NamedKey::ArrowDown) => {
168-
complexity = complexity.saturating_sub(1)
168+
complexity = complexity.saturating_sub(1);
169169
}
170170
Key::Named(NamedKey::Space) => {
171171
transform = Affine::IDENTITY;

src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,5 +95,5 @@ pub fn append_tree_with<F: FnMut(&mut vello::Scene, &usvg::Node)>(
9595
svg: &usvg::Tree,
9696
error_handler: &mut F,
9797
) {
98-
render::render_group(scene, svg.root(), error_handler)
98+
render::render_group(scene, svg.root(), error_handler);
9999
}

src/render.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ pub(crate) fn render_group<F: FnMut(&mut Scene, &usvg::Node)>(
6060
&local_path,
6161
);
6262
} else {
63-
error_handler(scene, node)
63+
error_handler(scene, node);
6464
}
6565
}
6666
};
@@ -78,7 +78,7 @@ pub(crate) fn render_group<F: FnMut(&mut Scene, &usvg::Node)>(
7878
&local_path,
7979
);
8080
} else {
81-
error_handler(scene, node)
81+
error_handler(scene, node);
8282
}
8383
}
8484
};

src/util.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -52,13 +52,13 @@ pub fn to_bez_path(path: &usvg::Path) -> BezPath {
5252
local_path.move_to(most_recent_initial);
5353
}
5454
most_recent_initial = (p.x.into(), p.y.into());
55-
local_path.move_to(most_recent_initial)
55+
local_path.move_to(most_recent_initial);
5656
}
5757
usvg::tiny_skia_path::PathSegment::LineTo(p) => {
5858
if std::mem::take(&mut just_closed) {
5959
local_path.move_to(most_recent_initial);
6060
}
61-
local_path.line_to(Point::new(p.x as f64, p.y as f64))
61+
local_path.line_to(Point::new(p.x as f64, p.y as f64));
6262
}
6363
usvg::tiny_skia_path::PathSegment::QuadTo(p1, p2) => {
6464
if std::mem::take(&mut just_closed) {
@@ -67,7 +67,7 @@ pub fn to_bez_path(path: &usvg::Path) -> BezPath {
6767
local_path.quad_to(
6868
Point::new(p1.x as f64, p1.y as f64),
6969
Point::new(p2.x as f64, p2.y as f64),
70-
)
70+
);
7171
}
7272
usvg::tiny_skia_path::PathSegment::CubicTo(p1, p2, p3) => {
7373
if std::mem::take(&mut just_closed) {
@@ -77,11 +77,11 @@ pub fn to_bez_path(path: &usvg::Path) -> BezPath {
7777
Point::new(p1.x as f64, p1.y as f64),
7878
Point::new(p2.x as f64, p2.y as f64),
7979
Point::new(p3.x as f64, p3.y as f64),
80-
)
80+
);
8181
}
8282
usvg::tiny_skia_path::PathSegment::Close => {
8383
just_closed = true;
84-
local_path.close_path()
84+
local_path.close_path();
8585
}
8686
}
8787
}

0 commit comments

Comments
 (0)