Skip to content

Commit 193bb51

Browse files
committed
Swapped deprecated try! -> ? because rustc was complaining
1 parent 002eff1 commit 193bb51

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/module.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ impl Module {
8484
unsafe {
8585
let mut out = mem::MaybeUninit::uninit();
8686
let mut err = mem::MaybeUninit::uninit();
87-
let buf = try!(MemoryBuffer::new_from_file(path));
87+
let buf = MemoryBuffer::new_from_file(path)?;
8888
if reader::LLVMParseBitcodeInContext(context.into(), buf.as_ptr(), out.as_mut_ptr(), err.as_mut_ptr()) == 1 {
8989
Err(CBox::new(err.assume_init()))
9090
} else {
@@ -180,7 +180,7 @@ impl Module {
180180
let path = path.to_str().unwrap();
181181
let mod_path = dir.join("module.bc");
182182
let mod_path = mod_path.to_str().unwrap();
183-
try!(self.write_bitcode(mod_path));
183+
self.write_bitcode(mod_path)?;
184184
Command::new("llc")
185185
.arg(&format!("-O={}", opt_level))
186186
.arg("-filetype=obj")

src/object.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ native_ref!(ObjectFile, obj: LLVMObjectFileRef);
1616
impl ObjectFile {
1717
/// Parse the object file at the path given, or return an error string if an error occurs.
1818
pub fn read(path: &str) -> Result<ObjectFile, CBox<str>> {
19-
let buf = try!(MemoryBuffer::new_from_file(path));
19+
let buf = MemoryBuffer::new_from_file(path)?;
2020
unsafe {
2121
let ptr = object::LLVMCreateObjectFile(buf.as_ptr());
2222
if ptr.is_null() {

0 commit comments

Comments
 (0)