Skip to content

Commit 6c55a7b

Browse files
committed
Add rust lint
1 parent b1abf33 commit 6c55a7b

File tree

6 files changed

+13
-19
lines changed

6 files changed

+13
-19
lines changed

bindings/devup-ui-wasm/src/lib.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -640,11 +640,11 @@ mod tests {
640640
#[test]
641641
#[serial]
642642
fn test_debug() {
643-
assert_eq!(is_debug(), false);
643+
assert!(!is_debug());
644644
set_debug(true);
645-
assert_eq!(is_debug(), true);
645+
assert!(is_debug());
646646
set_debug(false);
647-
assert_eq!(is_debug(), false);
647+
assert!(!is_debug());
648648
}
649649

650650
#[test]

libs/extractor/src/extract_style/extract_dynamic_style.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
use css::{
2-
optimize_value::optimize_value, sheet_to_classname,
3-
sheet_to_variable_name, style_selector::StyleSelector,
2+
optimize_value::optimize_value, sheet_to_classname, sheet_to_variable_name,
3+
style_selector::StyleSelector,
44
};
55

66
use crate::extract_style::{ExtractStyleProperty, style_property::StyleProperty};

libs/extractor/src/extract_style/extract_static_style.rs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,4 @@
1-
use css::{
2-
optimize_value::optimize_value, sheet_to_classname,
3-
style_selector::StyleSelector,
4-
};
1+
use css::{optimize_value::optimize_value, sheet_to_classname, style_selector::StyleSelector};
52

63
use crate::{
74
extract_style::{

libs/sheet/benches/my_benchmark.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
use criterion::{criterion_group, criterion_main, Criterion};
1+
use criterion::{Criterion, criterion_group, criterion_main};
22
use once_cell::sync::Lazy;
33
use regex::Regex;
44
use std::hint::black_box;

libs/sheet/src/lib.rs

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -755,13 +755,10 @@ mod tests {
755755
"my",
756756
0,
757757
"40px",
758-
Some(
759-
&StyleSelector::Media {
760-
query: "(min-width: 1024px)".to_string(),
761-
selector: Some("&:hover".to_string()),
762-
}
763-
.into(),
764-
),
758+
Some(&StyleSelector::Media {
759+
query: "(min-width: 1024px)".to_string(),
760+
selector: Some("&:hover".to_string()),
761+
}),
765762
None,
766763
);
767764

@@ -937,7 +934,7 @@ mod tests {
937934
"background-color",
938935
0,
939936
"red",
940-
Some(&StyleSelector::Selector("&:hover".to_string()).into()),
937+
Some(&StyleSelector::Selector("&:hover".to_string())),
941938
Some(255),
942939
);
943940

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
"description": "devup-ui",
66
"type": "module",
77
"scripts": {
8-
"lint": "pnpm -F @devup-ui/* lint",
8+
"lint": "pnpm -F @devup-ui/* lint && cargo fmt --all -- --check && cargo clippy --all-targets --all-features -- -D warnings",
99
"pretest": "pnpm -F @devup-ui/vite-plugin build",
1010
"test": "cargo tarpaulin --out xml --out stdout --out html --all-targets && vitest test --coverage --run && pnpm -r test",
1111
"build": "pnpm -F @devup-ui/* build",

0 commit comments

Comments
 (0)