Skip to content

Commit c730486

Browse files
authored
Merge pull request #139 from xixishidibei/master
chore: fix cargo clippy warning
2 parents 3e8f8ea + 0468ad9 commit c730486

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

src/library/exec.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -258,12 +258,12 @@ impl Lib {
258258
ExecStep::Call(site) => {
259259
#[cfg(feature = "log")]
260260
eprintln!("{d}calling{z} {m}{site}{z}");
261-
return Jump::Instr(site.into());
261+
return Jump::Instr(site);
262262
}
263263
ExecStep::Ret(site) => {
264264
#[cfg(feature = "log")]
265265
eprintln!("{d}returning to{z} {m}{site}{z}");
266-
return Jump::Next(site.into());
266+
return Jump::Next(site);
267267
}
268268
}
269269
}

src/library/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ impl Display for Lib {
134134
writeln!(f, "ISAE: {}", self.isae_string())?;
135135
writeln!(f, "CODE: {:x}", self.code)?;
136136
writeln!(f, "DATA: {:x}", self.data)?;
137-
if self.libs.len() > 0 {
137+
if !self.libs.is_empty() {
138138
writeln!(
139139
f,
140140
"LIBS: {:8}",

src/library/marshaller.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,7 @@ where
194194
fn write(&mut self, value: u32, bit_count: u5) -> Result<(), CodeEofError> {
195195
let mut cnt = bit_count.to_u8();
196196
let value = ((value as u64) << (self.bit_pos.to_u8())).to_le_bytes();
197-
let n_bytes = (cnt + self.bit_pos.to_u8() + 7) / 8;
197+
let n_bytes = (cnt + self.bit_pos.to_u8()).div_ceil(8);
198198
for i in 0..n_bytes {
199199
if self.bytecode.as_ref().len() >= u16::MAX as usize {
200200
return Err(CodeEofError);

0 commit comments

Comments
 (0)