Fix warning (#14)

This commit is contained in:
Thiago Santos 2020-10-20 13:15:16 -03:00 committed by GitHub
parent 6f3ccbb536
commit 0a693cb6ed
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -47,8 +47,8 @@ fn worksheets<'a>(env: Env<'a>, args: &[Term<'a>]) -> NifResult<Term<'a>> {
fn parse<'a>(env: Env<'a>, args: &[Term<'a>]) -> NifResult<Term<'a>> {
let filename: String = try!(args[0].decode());
let sheetname: String = try!(args[1].decode());
let filename: String = args[0].decode()?;
let sheetname: String = args[1].decode()?;
let mut excel = match open_workbook_auto(&filename) {
Err(ref error) => return Ok(io_error_to_term(env, error)),
@ -60,7 +60,7 @@ fn parse<'a>(env: Env<'a>, args: &[Term<'a>]) -> NifResult<Term<'a>> {
.rows()
.into_iter()
.enumerate()
.map(|(_i, col)|
.map(|(_i, col)|
col
.iter()
.map(|c|
@ -69,9 +69,9 @@ fn parse<'a>(env: Env<'a>, args: &[Term<'a>]) -> NifResult<Term<'a>> {
.collect::<Vec<_>>()
)
.collect::<Vec<_>>();
Ok((atoms::ok(), row.encode(env)).encode(env))
} else {
Ok((atoms::error(), "Couldnt find the worksheet").encode(env))
}
}
}