Skip to content

Commit d351813

Browse files
committed
refactor(port_std): prefix field names with underscores instead of applying #[allow(dead_code)]
If we had `JoinHandle::join`, it would use the field `JoinHandle:: std_handle`, but for now we don't need `JoinHandle::join`.
1 parent 0c14827 commit d351813

File tree

2 files changed

+10
-6
lines changed

2 files changed

+10
-6
lines changed

src/r3_port_std/src/threading_unix.rs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,7 @@ pub unsafe fn exit_thread() -> ! {
3333
/// [`std::thread::JoinHandle`] with extra functionalities.
3434
#[derive(Debug)]
3535
pub struct JoinHandle<T> {
36-
#[allow(dead_code)]
37-
std_handle: thread::JoinHandle<T>,
36+
_std_handle: thread::JoinHandle<T>,
3837
thread: Thread,
3938
}
4039

@@ -69,7 +68,10 @@ pub fn spawn(f: impl FnOnce() + Send + 'static) -> JoinHandle<()> {
6968
// Wait until the just-spawned thread configures its own `THREAD_DATA`.
7069
thread::park();
7170

72-
JoinHandle { std_handle, thread }
71+
JoinHandle {
72+
_std_handle: std_handle,
73+
thread,
74+
}
7375
}
7476

7577
impl<T> JoinHandle<T> {

src/r3_port_std/src/threading_windows.rs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,7 @@ pub use std::thread::ThreadId;
2222
/// [`std::thread::JoinHandle`] with extra functionalities.
2323
#[derive(Debug)]
2424
pub struct JoinHandle<T> {
25-
#[allow(dead_code)]
26-
std_handle: thread::JoinHandle<T>,
25+
_std_handle: thread::JoinHandle<T>,
2726
thread: Thread,
2827
}
2928

@@ -42,7 +41,10 @@ pub fn spawn(f: impl FnOnce() + Send + 'static) -> JoinHandle<()> {
4241

4342
let thread = Thread { data };
4443

45-
JoinHandle { std_handle, thread }
44+
JoinHandle {
45+
_std_handle: std_handle,
46+
thread,
47+
}
4648
}
4749

4850
impl<T> JoinHandle<T> {

0 commit comments

Comments
 (0)