diff options
author | 2016-01-15 08:41:06 +0100 | |
---|---|---|
committer | 2016-01-15 08:41:06 +0100 | |
commit | 36d60cd9a76fd496dbbff780942364fc88a60259 (patch) | |
tree | 55043b1fc6edf4c24a893fbfa096b83954188679 /src/segmentation.rs | |
parent | 19a86adc76cc4e931a2cf91a473eefebe6898632 (diff) | |
download | rust-x86-36d60cd9a76fd496dbbff780942364fc88a60259.tar.gz rust-x86-36d60cd9a76fd496dbbff780942364fc88a60259.tar.zst rust-x86-36d60cd9a76fd496dbbff780942364fc88a60259.zip |
Formatting with new cargo fmt command.
Signed-off-by: Gerd Zellweger <mail@gerdzellweger.com>
Diffstat (limited to 'src/segmentation.rs')
-rw-r--r-- | src/segmentation.rs | 31 |
1 files changed, 19 insertions, 12 deletions
diff --git a/src/segmentation.rs b/src/segmentation.rs index d2354d4..0a7ee15 100644 --- a/src/segmentation.rs +++ b/src/segmentation.rs @@ -27,11 +27,11 @@ impl SegmentSelector { /// * `index` index in GDT or LDT array. /// pub fn new(index: u16) -> SegmentSelector { - SegmentSelector{bits: index << 3} + SegmentSelector { bits: index << 3 } } - pub fn from_raw(bits: u16) -> SegmentSelector{ - SegmentSelector{bits: bits} + pub fn from_raw(bits: u16) -> SegmentSelector { + SegmentSelector { bits: bits } } } @@ -39,27 +39,34 @@ impl fmt::Debug for SegmentSelector { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { let r0 = match self.contains(RPL_0) { false => "", - true => "Ring 0 segment selector." + true => "Ring 0 segment selector.", }; let r1 = match self.contains(RPL_1) { false => "", - true => "Ring 1 segment selector." + true => "Ring 1 segment selector.", }; let r2 = match self.contains(RPL_2) { false => "", - true => "Ring 2 segment selector." + true => "Ring 2 segment selector.", }; let r3 = match self.contains(RPL_3) { false => "", - true => "Ring 3 segment selector." + true => "Ring 3 segment selector.", }; let tbl = match self.contains(TI_LDT) { false => "GDT Table", - true => "LDT Table" + true => "LDT Table", }; - write!(f, "Index {} in {}, {}{}{}{}", self.bits >> 3, tbl, r0, r1, r2, r3) - //write!(f, "Index") + write!(f, + "Index {} in {}, {}{}{}{}", + self.bits >> 3, + tbl, + r0, + r1, + r2, + r3) + // write!(f, "Index") } } @@ -149,8 +156,8 @@ impl SegmentDescriptor { let limit_low: u64 = limit as u64 & 0xffff; let limit_high: u64 = (limit as u64 & (0b1111 << 16)) >> 16; - SegmentDescriptor{ - bits: limit_low | base_low << 16 | limit_high << (32+16) | base_high << (32+24) + SegmentDescriptor { + bits: limit_low | base_low << 16 | limit_high << (32 + 16) | base_high << (32 + 24), } } } |