Skip to content

Commit

Permalink
chore: fix newly introduced clippy lints
Browse files Browse the repository at this point in the history
  • Loading branch information
jac3km4 committed Dec 17, 2022
1 parent e88cdd3 commit a03a41c
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion core/src/bundle.rs
Original file line number Diff line number Diff line change
Expand Up @@ -676,7 +676,7 @@ impl<A> Decode for PoolIndex<A> {
impl<A> Encode for PoolIndex<A> {
#[inline]
fn encode<O: io::Write>(&self, output: &mut O) -> io::Result<()> {
output.encode(&(self.value as u32))
output.encode(&self.value)
}
}

Expand Down
6 changes: 3 additions & 3 deletions core/src/bytecode.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1107,21 +1107,21 @@ impl<'a, Loc: Clone> CodeCursor<'a, Loc> {
}

pub fn pop(&mut self) -> Result<&Instr<Loc>, CursorError> {
let instr = self.code.get(self.index as usize).ok_or(CursorError::EndOfCode)?;
let instr = self.code.get(self.index).ok_or(CursorError::EndOfCode)?;
self.index += 1;
Ok(instr)
}

#[inline]
pub fn peek(&self) -> Option<&Instr<Loc>> {
self.code.get(self.index as usize)
self.code.get(self.index)
}

pub fn pos(&self) -> Location {
if self.index == 0 {
Location::ZERO
} else {
Location::new(self.offsets[self.index as usize - 1])
Location::new(self.offsets[self.index - 1])
}
}

Expand Down
6 changes: 3 additions & 3 deletions scc/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ fn main() -> ExitCode {
if !expected_bundle_path.exists() {
let base = get_base_bundle_path(&default_cache_dir);
fs::create_dir_all(&cache_dir).expect("Could not create the custom cache directory");
fs::copy(&base, expected_bundle_path).expect("Could not copy base bundle");
fs::copy(base, expected_bundle_path).expect("Could not copy base bundle");
}
(cache_dir, Some(default_cache_dir))
}
Expand Down Expand Up @@ -141,7 +141,7 @@ fn compile_scripts(cache_dir: &Path, fallback_cache_dir: Option<&Path>, files: &
.read(true)
.write(true)
.create(true)
.open(&timestamp_path)?,
.open(timestamp_path)?,
);
let mut ts_file = ts_lock.write()?;

Expand Down Expand Up @@ -247,7 +247,7 @@ struct ScriptManifest {
impl ScriptManifest {
pub fn load(script_dir: &Path) -> Result<Self, String> {
let path = script_dir.join("redscript.toml");
let contents = fs::read_to_string(&path).map_err(|err| match err.kind() {
let contents = fs::read_to_string(path).map_err(|err| match err.kind() {
io::ErrorKind::NotFound => "manifest not available".to_owned(),
_ => err.to_string(),
})?;
Expand Down

0 comments on commit a03a41c

Please sign in to comment.