Skip to content

Commit b958cea

Browse files
committed
various new 1.85 clippy lints
the packed structs almost certainly should be repr(C) (why does that default to repr(Rust)???) the indentation change is unfortunate and doc_overindented_list_items hasn't really convinced me that this *would* introduce broken spacing in rendered docs, but i don't have it in me to allow the lint for a few lines like this.
1 parent c849bab commit b958cea

File tree

4 files changed

+12
-14
lines changed

4 files changed

+12
-14
lines changed

bin/propolis-server/src/lib/stats/mod.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -134,12 +134,12 @@ impl Producer for ServerStats {
134134
///
135135
/// - `id`: The ID of the instance for whom this server is being started.
136136
/// - `config`: The metrics config options, including our address (on which we
137-
/// serve metrics for oximeter to collect), and the registration address (a
138-
/// Nexus instance through which we request registration as an oximeter
139-
/// producer).
137+
/// serve metrics for oximeter to collect), and the registration address (a
138+
/// Nexus instance through which we request registration as an oximeter
139+
/// producer).
140140
/// - `log`: A logger to use when logging from this routine.
141141
/// - `registry`: The oximeter [`ProducerRegistry`] that the spawned server will
142-
/// use to return metric data to oximeter on request.
142+
/// use to return metric data to oximeter on request.
143143
///
144144
/// The returned server will attempt to register with Nexus in a background
145145
/// task, and will periodically renew that registration. The returned server is

crates/rfb/src/proto.rs

+7-7
Original file line numberDiff line numberDiff line change
@@ -637,7 +637,7 @@ mod raw {
637637

638638
#[allow(dead_code)]
639639
#[derive(Copy, Clone, FromBytes, FromZeroes, AsBytes)]
640-
#[repr(packed)]
640+
#[repr(C, packed)]
641641
pub(crate) struct PixelFormat {
642642
pub bits_per_pixel: u8,
643643
pub depth: u8,
@@ -653,30 +653,30 @@ mod raw {
653653
}
654654

655655
#[derive(Copy, Clone, FromBytes, FromZeroes)]
656-
#[repr(packed)]
656+
#[repr(C, packed)]
657657
pub(crate) struct FramebufferUpdateRequest {
658658
pub incremental: u8,
659659
pub position: Position,
660660
pub resolution: Resolution,
661661
}
662662

663663
#[derive(Copy, Clone, FromBytes, FromZeroes)]
664-
#[repr(packed)]
664+
#[repr(C, packed)]
665665
pub(crate) struct KeyEvent {
666666
pub down_flag: u8,
667667
pub _padding: [u8; 2],
668668
pub key: U32,
669669
}
670670

671671
#[derive(Copy, Clone, FromBytes, FromZeroes)]
672-
#[repr(packed)]
672+
#[repr(C, packed)]
673673
pub(crate) struct PointerEvent {
674674
pub button_mask: u8,
675675
pub position: Position,
676676
}
677677

678678
#[derive(Copy, Clone, FromBytes, FromZeroes)]
679-
#[repr(packed)]
679+
#[repr(C, packed)]
680680
pub(crate) struct Position {
681681
pub x: U16,
682682
pub y: U16,
@@ -688,7 +688,7 @@ mod raw {
688688
}
689689

690690
#[derive(Copy, Clone, FromBytes, FromZeroes)]
691-
#[repr(packed)]
691+
#[repr(C, packed)]
692692
pub(crate) struct Resolution {
693693
width: U16,
694694
height: U16,
@@ -700,7 +700,7 @@ mod raw {
700700
}
701701

702702
#[derive(Copy, Clone, AsBytes)]
703-
#[repr(packed)]
703+
#[repr(C, packed)]
704704
#[allow(dead_code)]
705705
pub(crate) struct FramebufferUpdateHeader {
706706
msg_type: u8,

lib/propolis/src/vmm/mem.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1061,7 +1061,7 @@ impl<T: Copy + FromBytes> Iterator for GuestData<MemMany<'_, T>> {
10611061
fn next(&mut self) -> Option<Self::Item> {
10621062
let res = self.get(self.pos);
10631063
self.pos += 1;
1064-
res.map(GuestData::from)
1064+
res
10651065
}
10661066
}
10671067

xtask/src/task_phd.rs

-2
Original file line numberDiff line numberDiff line change
@@ -303,7 +303,6 @@ impl Cmd {
303303

304304
let artifact_dir = artifact_args
305305
.artifact_directory
306-
.map(Utf8PathBuf::from)
307306
.unwrap_or_else(|| {
308307
// if there's no explicitly overridden `artifact_dir` path, use
309308
// `target/phd/artifacts`.
@@ -334,7 +333,6 @@ impl Cmd {
334333

335334
let artifacts_toml = artifact_args
336335
.artifact_toml_path
337-
.map(Utf8PathBuf::from)
338336
.unwrap_or_else(|| {
339337
// if there's no explicitly overridden `artifacts.toml` path,
340338
// determine the default one from the workspace path.

0 commit comments

Comments
 (0)