Skip to content

Commit fddec6b

Browse files
author
emiguez
committed
fix(req changes): type translation uint -> usize
1 parent f8b6e3d commit fddec6b

File tree

5 files changed

+8
-8
lines changed

5 files changed

+8
-8
lines changed

src/bin/sl.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ trait Render: Train + Copy {
1616
let mut len = 0 as i32;
1717
let y = ncurses::LINES / 2;
1818
let body_iter = self.body().iter();
19-
let wheelset_iter = self.wheelset(x as u32).iter();
19+
let wheelset_iter = self.wheelset(x as usize).iter();
2020
let iter = body_iter.chain(wheelset_iter);
2121
let (_, hint) = iter.size_hint();
2222
let height = match hint {

src/c51.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ impl Train for C51 {
99
&C51BODY
1010
}
1111

12-
fn wheelset(&self, x: u32) -> &'static [&'static str] {
13-
&C51WHL[(x % 6) as usize]
12+
fn wheelset(&self, x: usize) -> &'static [&'static str] {
13+
&C51WHL[(x % 6)]
1414
}
1515

1616
fn tender(&self) -> Option<&'static [&'static str]> {

src/d51.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ impl Train for SL {
99
&D51BODY
1010
}
1111

12-
fn wheelset(&self, x: u32) -> &'static [&'static str] {
13-
&D51WHL[(x % 6) as usize]
12+
fn wheelset(&self, x: usize) -> &'static [&'static str] {
13+
&D51WHL[(x % 6)]
1414
}
1515

1616
fn tender(&self) -> Option<&'static [&'static str]> {

src/logo.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ impl Train for Logo {
99
&LOGO
1010
}
1111

12-
fn wheelset(&self, x: u32) -> &'static [&'static str] {
13-
&LWHL[(x % 6) as usize]
12+
fn wheelset(&self, x: usize) -> &'static [&'static str] {
13+
&LWHL[(x % 6)]
1414
}
1515

1616
fn tender(&self) -> Option<&'static [&'static str]> {

src/sl.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ mod data;
55

66
pub trait Train {
77
fn body(&self) -> &'static [&'static str];
8-
fn wheelset(&self, x: u32) -> &'static [&'static str];
8+
fn wheelset(&self, x: usize) -> &'static [&'static str];
99
fn tender(&self) -> Option<&'static [&'static str]> {
1010
None
1111
}

0 commit comments

Comments
 (0)