Skip to content

Commit eeae82c

Browse files
committed
style: Apply consistent Rust idioms and lint fixes
- Replace Default::default() with explicit struct constructors - Add reference parameters to prevent unnecessary moves - Update ignore attributes with descriptive reasons - Fix clippy warnings for unused variables and float comparisons - Standardize numeric literal formatting with underscores - Remove redundant all() wrappers in cfg conditions - Update core imports to prefer core over std where applicable
1 parent b9ff775 commit eeae82c

File tree

16 files changed

+42
-34
lines changed

16 files changed

+42
-34
lines changed

module/alias/winterval/examples/winterval_non_iterable.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
fn main() {
44
use winterval::{NonIterableInterval, IntoInterval, Bound};
55

6-
fn f1(interval: impl NonIterableInterval) {
6+
fn f1(interval: &impl NonIterableInterval) {
77
println!(
88
"Do something with this {:?} .. {:?} interval",
99
interval.left(),
@@ -12,12 +12,12 @@ fn main() {
1212
}
1313

1414
// Iterable/bound interval from tuple.
15-
f1((Bound::Included(0), Bound::Included(3)).into_interval());
15+
f1(&(Bound::Included(0), Bound::Included(3)).into_interval());
1616
// Non-iterable/unbound interval from tuple.
17-
f1((Bound::Included(0), Bound::Unbounded).into_interval());
17+
f1(&(Bound::Included(0), Bound::Unbounded).into_interval());
1818
// Non-iterable/unbound interval from `core::ops::RangeFrom`.
19-
f1(0..);
19+
f1(&(0..));
2020
// Non-iterable/unbound interval from `core::ops::RangeFull`
2121
// what is ( -Infinity .. +Infinity ).
22-
f1(..);
22+
f1(&(..));
2323
}

module/core/component_model_types/examples/component_model_types_trivial.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ fn main() {
5151
}
5252
}
5353

54-
let mut got: Person = Default::default();
54+
let mut got: Person = Person::default();
5555
got.assign(13);
5656
got.assign("John");
5757
assert_eq!(

module/core/component_model_types/tests/inc/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,12 @@ mod components_tests {
1010
#[ cfg( feature = "types_component_assign" ) ]
1111
mod component_assign_manual;
1212

13-
#[cfg(all(feature = "types_component_assign"))]
13+
#[cfg(feature = "types_component_assign")]
1414
mod components_assign_manual;
1515

1616
// #[ cfg( all( feature = "derive_from_components" ) ) ]
1717
mod from_components_manual;
1818

19-
#[cfg(all(feature = "types_component_assign"))]
19+
#[cfg(feature = "types_component_assign")]
2020
mod composite_manual;
2121
}

module/core/data_type/tests/smoke_test.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
//! Smoke testing of the package.
22
3-
#[ ignore ]
3+
#[ ignore = "temporarily disabled due to test_tools::test module gating issues" ]
44
#[ test ]
55
fn local_smoke_test() {
66
// xxx: temporarily disabled due to test_tools::test module gating issues
77
}
88

9-
#[ ignore ]
9+
#[ ignore = "temporarily disabled due to test_tools::test module gating issues" ]
1010
#[ test ]
1111
fn published_smoke_test() {
1212
// xxx: temporarily disabled due to test_tools::test module gating issues

module/core/format_tools/tests/inc/test_object.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,13 @@ use the_module::
1010
OptionalCow,
1111
};
1212

13-
use std::
13+
use core::
1414
{
1515
hash::Hasher,
1616
hash::Hash,
1717
cmp::Ordering,
18-
borrow::Cow,
1918
};
19+
use std::borrow::Cow;
2020

2121
use collection_tools::HashMap;
2222

module/core/former_types/examples/former_types_trivial.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ fn main() {
5151
}
5252
}
5353

54-
let mut got: Person = Default::default();
54+
let mut got: Person = Person::default();
5555
got.assign(13);
5656
got.assign("John");
5757
assert_eq!(

module/core/interval_adapter/examples/interval_adapter_non_iterable.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
fn main() {
33
use interval_adapter::{NonIterableInterval, IntoInterval, Bound};
44

5-
fn f1(interval: impl NonIterableInterval) {
5+
fn f1(interval: &impl NonIterableInterval) {
66
println!(
77
"Do something with this {:?} .. {:?} interval",
88
interval.left(),
@@ -11,12 +11,12 @@ fn main() {
1111
}
1212

1313
// Iterable/bound interval from tuple.
14-
f1((Bound::Included(0), Bound::Included(3)).into_interval());
14+
f1(&(Bound::Included(0), Bound::Included(3)).into_interval());
1515
// Non-iterable/unbound interval from tuple.
16-
f1((Bound::Included(0), Bound::Unbounded).into_interval());
16+
f1(&(Bound::Included(0), Bound::Unbounded).into_interval());
1717
// Non-iterable/unbound interval from `core::ops::RangeFrom`.
18-
f1(0..);
18+
f1(&(0..));
1919
// Non-iterable/unbound interval from `core::ops::RangeFull`
2020
// what is ( -Infinity .. +Infinity ).
21-
f1(..);
21+
f1(&(..));
2222
}

module/core/mod_interface_meta/tests/smoke_test.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
//! Smoke testing of the package.
22
3-
#[ ignore ]
3+
#[ ignore = "temporarily disabled due to test_tools::test module gating issues" ]
44
#[ test ]
55
fn local_smoke_test() {
66
// xxx: temporarily disabled due to test_tools::test module gating issues
77
}
88

9-
#[ ignore ]
9+
#[ ignore = "temporarily disabled due to test_tools::test module gating issues" ]
1010
#[ test ]
1111
fn published_smoke_test() {
1212
// xxx: temporarily disabled due to test_tools::test module gating issues

module/core/process_tools/tests/smoke_test.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
//! Smoke testing of the package.
22
3-
#[ ignore ]
3+
#[ ignore = "temporarily disabled due to test_tools::test module gating issues" ]
44
#[ test ]
55
fn local_smoke_test() {
66
// xxx: temporarily disabled due to test_tools::test module gating issues
77
}
88

9-
#[ ignore ]
9+
#[ ignore = "temporarily disabled due to test_tools::test module gating issues" ]
1010
#[ test ]
1111
fn published_smoke_test() {
1212
// xxx: temporarily disabled due to test_tools::test module gating issues

module/core/process_tools/tests/tool/asset.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,7 @@ pub struct ProgramRun {
104104

105105
#[ derive( Debug ) ]
106106
#[ allow( dead_code ) ]
107+
#[ allow( clippy::enum_variant_names ) ]
107108
pub enum GetData {
108109
FromStr(&'static str),
109110
FromBin(&'static [u8]),

0 commit comments

Comments
 (0)