aboutsummaryrefslogtreecommitdiffstats
path: root/src/cell.rs
diff options
context:
space:
mode:
authorJesse Luehrs <doy@tozt.net>2021-12-15 00:08:57 -0500
committerJesse Luehrs <doy@tozt.net>2021-12-15 00:09:53 -0500
commit866b160b9c9db80afde0b5855380cfe36e0f532c (patch)
treee5fd78a6bbf29271483e462f1399e1660b39a43a /src/cell.rs
parentc97d712c5266ec2c4095c90ef3553bc9741a8b1a (diff)
downloadvt100-rust-866b160b9c9db80afde0b5855380cfe36e0f532c.tar.gz
vt100-rust-866b160b9c9db80afde0b5855380cfe36e0f532c.zip
more conversion to indexing
Diffstat (limited to 'src/cell.rs')
-rw-r--r--src/cell.rs7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/cell.rs b/src/cell.rs
index aa7532e..baa99bb 100644
--- a/src/cell.rs
+++ b/src/cell.rs
@@ -20,8 +20,7 @@ impl PartialEq<Self> for Cell {
}
let len = self.len();
// self.len() always returns a valid value
- self.contents.get(..len).unwrap()
- == other.contents.get(..len).unwrap()
+ self.contents[..len] == other.contents[..len]
}
}
@@ -48,13 +47,13 @@ impl Cell {
}
if len == 0 {
// 0 is always less than 6
- *self.contents.get_mut(0).unwrap() = ' ';
+ self.contents[0] = ' ';
self.len += 1;
}
let len = self.len();
// we already checked that len < CODEPOINTS_IN_CELL
- *self.contents.get_mut(len).unwrap() = c;
+ self.contents[len] = c;
self.len += 1;
}