Skip to content

Commit

Permalink
Address feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
syrusakbary committed Apr 7, 2020
1 parent c475950 commit 3735dc2
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/commands/run.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@ use crate::common::{get_cache_dir, PrestandardFeatures};
use crate::utils::read_file_contents;
use std::collections::HashMap;
use std::fs::read_to_string;
#[cfg(feature = "backend-llvm")]
use std::fs::File;
use std::path::PathBuf;
use std::process::exit;
use std::str::FromStr;
Expand Down Expand Up @@ -462,6 +460,8 @@ impl LLVMCallbacks for LLVMCLIOptions {
}

fn obj_memory_buffer_callback(&mut self, memory_buffer: &InkwellMemoryBuffer) {
use std::fs::File;
use std::io::Write;
if let Some(filename) = &self.obj_file {
let mem_buf_slice = memory_buffer.as_slice();
let mut file = File::create(filename).unwrap();
Expand Down
2 changes: 0 additions & 2 deletions src/utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -129,8 +129,6 @@ pub fn read_file_contents(path: &PathBuf) -> Result<Vec<u8>, io::Error> {
let mut buffer: Vec<u8> = Vec::new();
let mut file = File::open(path)?;
file.read_to_end(&mut buffer)?;
// We force to close the file
drop(file);
Ok(buffer)
}

Expand Down

0 comments on commit 3735dc2

Please sign in to comment.