We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 392d376 commit c0c6b81Copy full SHA for c0c6b81
library/std/src/sys/pal/unix/thread.rs
@@ -132,14 +132,12 @@ impl Thread {
132
#[cfg(any(target_os = "linux", target_os = "freebsd", target_os = "dragonfly"))]
133
pub fn set_name(name: &CStr) {
134
unsafe {
135
- let name = {
136
- cfg_if::cfg_if! {
137
- if #[cfg(target_os = "linux")] {
138
- const TASK_COMM_LEN: usize = 16;
139
- &truncate_cstr::<{ TASK_COMM_LEN }>(name)
140
- } else {
141
- name.to_bytes()
142
- }
+ cfg_if::cfg_if! {
+ if #[cfg(target_os = "linux")] {
+ const TASK_COMM_LEN: usize = 16;
+ let name = &truncate_cstr::<{ TASK_COMM_LEN }>(name);
+ } else {
+ let name = name.to_bytes();
143
}
144
};
145
// Available since glibc 2.12, musl 1.1.16, and uClibc 1.0.20 for Linux,
0 commit comments