Skip to content

Commit b219a9d

Browse files
glambersonlamco-office
authored andcommitted
style: apply stable rustfmt to clearcodec modules
1 parent dd1cca5 commit b219a9d

7 files changed

Lines changed: 21 additions & 21 deletions

File tree

crates/ironrdp-graphics/src/clearcodec/mod.rs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,16 +7,16 @@
77
mod glyph_cache;
88
mod vbar_cache;
99

10-
pub use self::glyph_cache::{GlyphCache, GlyphEntry, GLYPH_CACHE_SIZE};
10+
pub use self::glyph_cache::{GLYPH_CACHE_SIZE, GlyphCache, GlyphEntry};
1111
pub use self::vbar_cache::{FullVBar, ShortVBar, VBarCache};
1212

1313
/// Glyph cache size as u16 for index arithmetic. GLYPH_CACHE_SIZE=4000 fits in u16.
1414
const GLYPH_CACHE_WRAP: u16 = 4_000;
1515

16-
use ironrdp_core::{invalid_field_err, DecodeResult, ReadCursor};
16+
use ironrdp_core::{DecodeResult, ReadCursor, invalid_field_err};
1717
use ironrdp_pdu::codecs::clearcodec::{
18-
decode_bands_layer, decode_residual_layer, decode_subcodec_layer, encode_residual_layer, ClearCodecBitmapStream,
19-
CompositePayload, RgbRunSegment, SubcodecId, VBar, FLAG_GLYPH_INDEX,
18+
ClearCodecBitmapStream, CompositePayload, FLAG_GLYPH_INDEX, RgbRunSegment, SubcodecId, VBar, decode_bands_layer,
19+
decode_residual_layer, decode_subcodec_layer, encode_residual_layer,
2020
};
2121

2222
/// ClearCodec decoder maintaining persistent cache state across frames.
@@ -510,10 +510,10 @@ fn bgra_to_run_segments(bgra: &[u8], pixel_count: usize) -> Vec<RgbRunSegment> {
510510

511511
#[cfg(test)]
512512
mod tests {
513-
use super::*;
514-
515513
use ironrdp_pdu::codecs::clearcodec::{FLAG_CACHE_RESET, FLAG_GLYPH_HIT};
516514

515+
use super::*;
516+
517517
fn make_residual_only_stream(width: u16, height: u16, blue: u8, green: u8, red: u8) -> Vec<u8> {
518518
let pixel_count = u32::from(width) * u32::from(height);
519519
let mut data = Vec::new();
@@ -568,7 +568,7 @@ mod tests {
568568
stream.push(FLAG_GLYPH_INDEX); // flags
569569
stream.push(0x00); // seq
570570
stream.extend_from_slice(&42u16.to_le_bytes()); // glyph_index = 42
571-
// Composite with 1-pixel residual (white)
571+
// Composite with 1-pixel residual (white)
572572
let residual = [0xFF, 0xFF, 0xFF, 0x01]; // BGR white, run=1
573573
stream.extend_from_slice(&4u32.to_le_bytes()); // residual bytes
574574
stream.extend_from_slice(&0u32.to_le_bytes()); // bands bytes
@@ -614,7 +614,7 @@ mod tests {
614614

615615
let pixels = decoder.decode(&stream, 2, 1).unwrap();
616616
assert_eq!(pixels.len(), 2 * 4); // 2 pixels * BGRA
617-
// Pixel 0: red (BGR: 0x00, 0x00, 0xFF)
617+
// Pixel 0: red (BGR: 0x00, 0x00, 0xFF)
618618
assert_eq!(&pixels[0..4], &[0x00, 0x00, 0xFF, 0xFF]);
619619
// Pixel 1: blue (BGR: 0xFF, 0x00, 0x00)
620620
assert_eq!(&pixels[4..8], &[0xFF, 0x00, 0x00, 0xFF]);

crates/ironrdp-graphics/src/clearcodec/vbar_cache.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,7 @@ mod tests {
181181
let full = VBarCache::reconstruct_full_vbar(&short, 4, 0xAA, 0xBB, 0xCC);
182182
// Height=4: 1 bg row, 2 data rows, 1 bg row
183183
assert_eq!(full.pixels.len(), 12); // 4 * 3
184-
// Row 0: background
184+
// Row 0: background
185185
assert_eq!(&full.pixels[0..3], &[0xAA, 0xBB, 0xCC]);
186186
// Row 1-2: pixel data
187187
assert_eq!(&full.pixels[3..9], &[0xFF, 0x00, 0x00, 0x00, 0xFF, 0x00]);

crates/ironrdp-pdu/src/codecs/clearcodec/bands.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
//! (full V-bar storage + short V-bar storage) to exploit recurring vertical
77
//! column patterns typical of text glyphs.
88
9-
use ironrdp_core::{ensure_size, invalid_field_err, DecodeResult, ReadCursor};
9+
use ironrdp_core::{DecodeResult, ReadCursor, ensure_size, invalid_field_err};
1010

1111
/// Maximum band height per the spec.
1212
pub const MAX_BAND_HEIGHT: u16 = 52;

crates/ironrdp-pdu/src/codecs/clearcodec/mod.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,14 @@ mod residual;
1111
mod rlex;
1212
mod subcodec;
1313

14-
use ironrdp_core::{cast_length, ensure_size, invalid_field_err, DecodeResult, ReadCursor};
14+
use ironrdp_core::{DecodeResult, ReadCursor, cast_length, ensure_size, invalid_field_err};
1515

1616
pub use self::bands::{
17-
decode_bands_layer, Band, ShortVBarCacheMiss, VBar, MAX_BAND_HEIGHT, SHORT_VBAR_CACHE_SIZE, VBAR_CACHE_SIZE,
17+
Band, MAX_BAND_HEIGHT, SHORT_VBAR_CACHE_SIZE, ShortVBarCacheMiss, VBAR_CACHE_SIZE, VBar, decode_bands_layer,
1818
};
19-
pub use self::residual::{decode_residual_layer, encode_residual_layer, RgbRunSegment};
20-
pub use self::rlex::{decode_rlex, RlexData, RlexSegment, MAX_PALETTE_COUNT};
21-
pub use self::subcodec::{decode_subcodec_layer, Subcodec, SubcodecId};
19+
pub use self::residual::{RgbRunSegment, decode_residual_layer, encode_residual_layer};
20+
pub use self::rlex::{MAX_PALETTE_COUNT, RlexData, RlexSegment, decode_rlex};
21+
pub use self::subcodec::{Subcodec, SubcodecId, decode_subcodec_layer};
2222

2323
// --- Flag constants ---
2424

crates/ironrdp-pdu/src/codecs/clearcodec/residual.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
//! run-length-encoded BGR pixel runs. This forms the base layer onto which
55
//! bands and subcodec regions are composited.
66
7-
use ironrdp_core::{ensure_size, DecodeResult, ReadCursor};
7+
use ironrdp_core::{DecodeResult, ReadCursor, ensure_size};
88

99
/// A single BGR run-length segment.
1010
///

crates/ironrdp-pdu/src/codecs/clearcodec/rlex.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
//! It encodes each pixel as a pair: a "run" of repeated color followed
55
//! by a "suite" (sequential palette walk from startIndex to stopIndex).
66
7-
use ironrdp_core::{ensure_size, invalid_field_err, DecodeResult, ReadCursor};
7+
use ironrdp_core::{DecodeResult, ReadCursor, ensure_size, invalid_field_err};
88

99
/// Maximum palette size per spec.
1010
pub const MAX_PALETTE_COUNT: u8 = 127;
@@ -184,10 +184,10 @@ mod tests {
184184
data.push(2); // palette_count
185185
data.extend_from_slice(&[0x00, 0x00, 0x00]); // black BGR
186186
data.extend_from_slice(&[0xFF, 0xFF, 0xFF]); // white BGR
187-
// Segment: packed byte, stop_index=0 (1 bit), suite_depth=0 (7 bits), run=5
187+
// Segment: packed byte, stop_index=0 (1 bit), suite_depth=0 (7 bits), run=5
188188
data.push(0x00); // packed: stop=0, depth=0
189189
data.push(5); // run_length=5
190-
// Segment: stop_index=1, suite_depth=0, run=3
190+
// Segment: stop_index=1, suite_depth=0, run=3
191191
data.push(0x01); // packed: stop=1, depth=0
192192
data.push(3); // run_length=3
193193

crates/ironrdp-pdu/src/codecs/clearcodec/subcodec.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
//! raw BGR pixels, NSCodec, or RLEX. Each subcodec region specifies its
55
//! position, dimensions, and the codec used to compress its bitmap data.
66
7-
use ironrdp_core::{cast_length, ensure_size, invalid_field_err, DecodeResult, ReadCursor};
7+
use ironrdp_core::{DecodeResult, ReadCursor, cast_length, ensure_size, invalid_field_err};
88

99
/// Subcodec identifier.
1010
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
@@ -103,7 +103,7 @@ mod tests {
103103
data.extend_from_slice(&2u16.to_le_bytes()); // height
104104
data.extend_from_slice(&12u32.to_le_bytes()); // bitmapDataByteCount = 2*2*3 = 12
105105
data.push(0x00); // subCodecId = Raw
106-
// 4 pixels BGR
106+
// 4 pixels BGR
107107
data.extend_from_slice(&[0xFF, 0x00, 0x00]); // blue
108108
data.extend_from_slice(&[0x00, 0xFF, 0x00]); // green
109109
data.extend_from_slice(&[0x00, 0x00, 0xFF]); // red

0 commit comments

Comments
 (0)