Remove warnings in tests;

This commit is contained in:
Benjamin Bouvier
2019-01-03 18:09:38 +01:00
committed by Dan Gohman
parent c78a9a4a7c
commit 03c22ed67a
4 changed files with 5 additions and 7 deletions

View File

@@ -484,7 +484,6 @@ impl<T: EntityRef + ReservedValue> EntityList<T> {
mod tests {
use super::*;
use super::{sclass_for_length, sclass_size};
use crate::packed_option::ReservedValue;
use crate::EntityRef;
/// An opaque reference to an instruction in a function.

View File

@@ -223,8 +223,8 @@ mod tests {
}
func
.to_string()
.trim_left_matches("function u0:0() fast {\n")
.trim_right_matches("\n}\n")
.trim_start_matches("function u0:0() fast {\n")
.trim_end_matches("\n}\n")
.to_string()
}};
}

View File

@@ -100,8 +100,7 @@ fn main() {
}
}
("deserialize", Some(m)) => {
let mut file =
File::open(m.value_of("FILE").unwrap()).expect("Unable to open the file");
let file = File::open(m.value_of("FILE").unwrap()).expect("Unable to open the file");
call_de(&file)
}
_ => Err("Invalid subcommand.".to_string()),

View File

@@ -745,7 +745,7 @@ pub fn populate_inst(func: &Function, ebb: Ebb) -> Vec<SerInst> {
let mut ser_vec: Vec<SerInst> = Vec::new();
let ret_iter = func.layout.ebb_insts(ebb);
for inst in ret_iter {
let mut ser_inst: SerInst = SerInst::new(inst, &func);
let ser_inst: SerInst = SerInst::new(inst, &func);
ser_vec.push(ser_inst);
}
ser_vec
@@ -867,7 +867,7 @@ impl SerObj {
pub fn new(funcs: &[Function]) -> Self {
let mut func_vec: Vec<SerFunction> = Vec::new();
for func in funcs {
let mut ser_func: SerFunction = SerFunction::new(&func);
let ser_func: SerFunction = SerFunction::new(&func);
func_vec.push(ser_func);
}
Self::create_new(func_vec)