Skip to content

Commit 2e15b31

Browse files
committed
refactor(test_suite): address the "field is never read" warnings
1 parent 16ed714 commit 2e15b31

File tree

4 files changed

+22
-12
lines changed

4 files changed

+22
-12
lines changed

src/constance_test_suite/src/kernel_tests/basic.rs

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,21 @@
11
//! Runs a task at startup.
22
use constance::{kernel::Task, prelude::*};
3+
use core::marker::PhantomData;
34

45
use super::Driver;
56

67
pub struct App<System> {
7-
task: Task<System>,
8+
_phantom: PhantomData<System>,
89
}
910

1011
impl<System: Kernel> App<System> {
1112
constance::configure! {
1213
pub const fn new<D: Driver<Self>>(_: &mut CfgBuilder<System>) -> Self {
13-
let task = new! { Task<_>, start = task_body::<System, D>, priority = 0, active = true };
14+
new! { Task<_>, start = task_body::<System, D>, priority = 0, active = true };
1415

15-
App { task }
16+
App {
17+
_phantom: PhantomData,
18+
}
1619
}
1720
}
1821
}

src/constance_test_suite/src/kernel_tests/cpu_lock.rs

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,21 @@
11
//! Activates and deactivates CPU Lock.
22
use constance::{kernel::Task, prelude::*};
3+
use core::marker::PhantomData;
34

45
use super::Driver;
56

67
pub struct App<System> {
7-
task: Task<System>,
8+
_phantom: PhantomData<System>,
89
}
910

1011
impl<System: Kernel> App<System> {
1112
constance::configure! {
1213
pub const fn new<D: Driver<Self>>(_: &mut CfgBuilder<System>) -> Self {
13-
let task = new! { Task<_>, start = task_body::<System, D>, priority = 0, active = true };
14+
new! { Task<_>, start = task_body::<System, D>, priority = 0, active = true };
1415

15-
App { task }
16+
App {
17+
_phantom: PhantomData,
18+
}
1619
}
1720
}
1821
}

src/constance_test_suite/src/kernel_tests/priority_boost.rs

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,21 @@
11
//! Activates and deactivates Priority Boost.
22
use constance::{kernel::Task, prelude::*};
3+
use core::marker::PhantomData;
34

45
use super::Driver;
56

67
pub struct App<System> {
7-
task: Task<System>,
8+
_phantom: PhantomData<System>,
89
}
910

1011
impl<System: Kernel> App<System> {
1112
constance::configure! {
1213
pub const fn new<D: Driver<Self>>(_: &mut CfgBuilder<System>) -> Self {
13-
let task = new! { Task<_>, start = task_body::<System, D>, priority = 0, active = true };
14+
new! { Task<_>, start = task_body::<System, D>, priority = 0, active = true };
1415

15-
App { task }
16+
App {
17+
_phantom: PhantomData,
18+
}
1619
}
1720
}
1821
}

src/constance_test_suite/src/kernel_tests/time_misc.rs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,19 +5,20 @@ use constance::{
55
prelude::*,
66
time::{Duration, Time},
77
};
8+
use core::marker::PhantomData;
89

910
use super::Driver;
1011

1112
pub struct App<System> {
12-
task: Task<System>,
13+
_phantom: PhantomData<System>,
1314
}
1415

1516
impl<System: Kernel> App<System> {
1617
constance::configure! {
1718
pub const fn new<D: Driver<Self>>(_: &mut CfgBuilder<System>) -> Self {
18-
let task = new! { Task<_>, start = task_body::<System, D>, priority = 0, active = true };
19+
new! { Task<_>, start = task_body::<System, D>, priority = 0, active = true };
1920

20-
App { task }
21+
App { _phantom: PhantomData }
2122
}
2223
}
2324
}

0 commit comments

Comments
 (0)