diff options
author | Jesse Luehrs <doy@tozt.net> | 2018-09-23 19:17:16 -0400 |
---|---|---|
committer | Jesse Luehrs <doy@tozt.net> | 2018-09-23 19:17:16 -0400 |
commit | 0cd015222e80497c823fc0eadc8f55c45860bade (patch) | |
tree | faf7f729454b299783b4b62733d84eabf32bfb3e /src/cell.rs | |
parent | 055e326906a7d5519cf28f37b6ec17ecbac8bdad (diff) | |
download | vt100-rust-0cd015222e80497c823fc0eadc8f55c45860bade.tar.gz vt100-rust-0cd015222e80497c823fc0eadc8f55c45860bade.zip |
clippy
Diffstat (limited to 'src/cell.rs')
-rw-r--r-- | src/cell.rs | 28 |
1 files changed, 7 insertions, 21 deletions
diff --git a/src/cell.rs b/src/cell.rs index abec58f..bf50817 100644 --- a/src/cell.rs +++ b/src/cell.rs @@ -21,9 +21,7 @@ impl Cell { pub fn contents(&self) -> &str { let Cell(cell_impl) = *self; - let prefix: *mut CellPrefix = unsafe { - std::mem::transmute(cell_impl) - }; + let prefix: *mut CellPrefix = cell_impl as *mut CellPrefix; let contents: &[u8] = unsafe { std::slice::from_raw_parts( &(*prefix).contents as *const i8 as *const u8, @@ -35,18 +33,14 @@ impl Cell { pub fn fgcolor(&self) -> color::Color { let Cell(cell_impl) = *self; - let prefix: *mut CellPrefix = unsafe { - std::mem::transmute(cell_impl) - }; + let prefix: *mut CellPrefix = cell_impl as *mut CellPrefix; let attrs = unsafe { &(*prefix).attrs }; color::Color::new(&attrs.fgcolor) } pub fn bgcolor(&self) -> color::Color { let Cell(cell_impl) = *self; - let prefix: *mut CellPrefix = unsafe { - std::mem::transmute(cell_impl) - }; + let prefix: *mut CellPrefix = cell_impl as *mut CellPrefix; let attrs = unsafe { &(*prefix).attrs }; color::Color::new(&attrs.bgcolor) } @@ -58,9 +52,7 @@ impl Cell { pub fn bold(&self) -> bool { let Cell(cell_impl) = *self; - let prefix: *mut CellPrefix = unsafe { - std::mem::transmute(cell_impl) - }; + let prefix: *mut CellPrefix = cell_impl as *mut CellPrefix; unsafe { ffi::vt100_wrapper_cell_attrs_bold(&mut (*prefix).attrs) != 0 } @@ -68,9 +60,7 @@ impl Cell { pub fn italic(&self) -> bool { let Cell(cell_impl) = *self; - let prefix: *mut CellPrefix = unsafe { - std::mem::transmute(cell_impl) - }; + let prefix: *mut CellPrefix = cell_impl as *mut CellPrefix; unsafe { ffi::vt100_wrapper_cell_attrs_italic(&mut (*prefix).attrs) != 0 } @@ -78,9 +68,7 @@ impl Cell { pub fn underline(&self) -> bool { let Cell(cell_impl) = *self; - let prefix: *mut CellPrefix = unsafe { - std::mem::transmute(cell_impl) - }; + let prefix: *mut CellPrefix = cell_impl as *mut CellPrefix; unsafe { ffi::vt100_wrapper_cell_attrs_underline(&mut (*prefix).attrs) != 0 } @@ -88,9 +76,7 @@ impl Cell { pub fn inverse(&self) -> bool { let Cell(cell_impl) = *self; - let prefix: *mut CellPrefix = unsafe { - std::mem::transmute(cell_impl) - }; + let prefix: *mut CellPrefix = cell_impl as *mut CellPrefix; unsafe { ffi::vt100_wrapper_cell_attrs_inverse(&mut (*prefix).attrs) != 0 } |