diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/cell.rs | 2 | ||||
-rw-r--r-- | src/lib.rs | 3 | ||||
-rw-r--r-- | src/row.rs | 2 |
3 files changed, 3 insertions, 4 deletions
diff --git a/src/cell.rs b/src/cell.rs index bc25cec..f27b1bd 100644 --- a/src/cell.rs +++ b/src/cell.rs @@ -190,7 +190,7 @@ impl Cell { /// Set horizontal span for this cell (must be > 0) pub fn set_hspan(&mut self, hspan: usize) { - self.hspan = if hspan <= 0 {1} else {hspan}; + self.hspan = if hspan == 0 {1} else {hspan}; } /// Get horizontal span of this cell (> 0) @@ -15,7 +15,6 @@ use std::fmt; use std::iter::{FromIterator, IntoIterator}; use std::slice::{Iter, IterMut}; use std::ops::{Index, IndexMut}; -use std::mem::transmute; pub use term::{Attr, color}; pub(crate) use term::{Terminal, stdout}; @@ -502,7 +501,7 @@ impl<'a> AsRef<TableSlice<'a>> for Table { // All this is a bit hacky. Let's try to find something else let s = &mut *((self as *const Table) as *mut Table); s.rows.shrink_to_fit(); - transmute(self) + &*(self as *const Table as *const TableSlice<'a>) } } } @@ -66,7 +66,7 @@ impl Row { pub fn get_column_width(&self, column: usize, format: &TableFormat) -> usize { let mut i = 0; for c in &self.cells { - if i + c.get_hspan()-1 >= column { + if i + c.get_hspan() > column { if c.get_hspan() == 1 { return c.get_width(); } |