Browse Source

Fix clippy warnings

pull/64/head
Garrit Franke 1 year ago
parent
commit
3f18b88b2a
Signed by: garrit
GPG Key ID: 65586C4DDA55EA2C
  1. 2
      src/command/build.rs
  2. 2
      src/command/run.rs
  3. 2
      src/generator/qbe.rs

2
src/command/build.rs

@ -21,7 +21,7 @@ use std::io::Write;
use std::path::Path;
pub fn build(target: &Target, in_file: &Path, out_file: &Path) -> Result<(), String> {
let mut buf = Box::new(Vec::new());
let mut buf = Box::<Vec<u8>>::default();
build_to_buffer(target, in_file, &mut buf)?;
if out_file.to_str() == Some("-") {

2
src/command/run.rs

@ -22,7 +22,7 @@ use std::process::Command;
use std::process::Stdio;
pub fn run(target: Target, in_file: PathBuf) -> Result<(), String> {
let mut buf = Box::new(Vec::new());
let mut buf = Box::<Vec<u8>>::default();
build::build_to_buffer(&target, &in_file, &mut buf)?;
match target {

2
src/generator/qbe.rs

@ -270,7 +270,7 @@ impl QbeGenerator {
func.assign_instr(
tmp.clone(),
qbe::Type::Word,
qbe::Instr::Copy(qbe::Value::Const(if *literal { 1 } else { 0 })),
qbe::Instr::Copy(qbe::Value::Const(u64::from(*literal))),
);
Ok((qbe::Type::Word, tmp))

Loading…
Cancel
Save