Skip to content

Commit

Permalink
Update fs.rs.
Browse files Browse the repository at this point in the history
  • Loading branch information
dariusc93 committed Nov 18, 2018
1 parent e72aa79 commit f6c5e6d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/bindings/fs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ pub fn init(lua: &Lua) -> Result<(), LuaError> {

module.set("read_file", lua.create_function( |lua, path: String| {
let data = fs::read(path).map_err(|err| LuaError::external(err))?;
Ok(lua.create_string(&data)?)
Ok(lua.create_string(&String::from_utf8_lossy(&data[..]).to_owned().to_string())?)
})?)?;

module.set("exists", lua.create_function( |_, path: String| {
Expand Down

4 comments on commit f6c5e6d

@Arnaz87
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why is this?

@naturallymitchell
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

because we couldn't read private key from disk, I think

@Arnaz87
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't understand, is this to read binary files? If it is I think private keys are plain text

@naturallymitchell
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, that's what we were doing
so, that'd make sense

Please sign in to comment.