aboutsummaryrefslogtreecommitdiffstats
path: root/src/screen.rs
diff options
context:
space:
mode:
authorJesse Luehrs <doy@tozt.net>2021-12-14 04:14:44 -0500
committerJesse Luehrs <doy@tozt.net>2021-12-14 04:14:44 -0500
commit585634384a92084412807ed9d10712fdfd561da0 (patch)
tree501afe1768d2b2212e45fce2ad54df4711260cea /src/screen.rs
parent2083eae2c5b480ccad672fb2fbb1b2bb5774a606 (diff)
downloadvt100-rust-585634384a92084412807ed9d10712fdfd561da0.tar.gz
vt100-rust-585634384a92084412807ed9d10712fdfd561da0.zip
also stop using as casts
Diffstat (limited to 'src/screen.rs')
-rw-r--r--src/screen.rs12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/screen.rs b/src/screen.rs
index 95951d9..d083d4e 100644
--- a/src/screen.rs
+++ b/src/screen.rs
@@ -194,10 +194,10 @@ impl Screen {
.grid()
.visible_rows()
.enumerate()
- .skip(start_row as usize)
- .take(end_row as usize - start_row as usize + 1)
+ .skip(usize::from(start_row))
+ .take(usize::from(end_row) - usize::from(start_row) + 1)
{
- if i == start_row as usize {
+ if i == usize::from(start_row) {
row.write_contents(
&mut contents,
start_col,
@@ -207,7 +207,7 @@ impl Screen {
if !row.wrapped() {
contents.push('\n');
}
- } else if i == end_row as usize {
+ } else if i == usize::from(end_row) {
row.write_contents(&mut contents, 0, end_col, false);
} else {
row.write_contents(&mut contents, 0, cols, false);
@@ -221,7 +221,7 @@ impl Screen {
std::cmp::Ordering::Equal => {
if start_col < end_col {
self.rows(start_col, end_col - start_col)
- .nth(start_row as usize)
+ .nth(usize::from(start_row))
.unwrap_or_else(String::new)
} else {
String::new()
@@ -811,7 +811,7 @@ impl Screen {
let attrs = self.attrs;
let width = c.width();
- if width.is_none() && (c as u32) < 256 {
+ if width.is_none() && (u32::from(c)) < 256 {
// don't even try to draw control characters
return;
}