gchp / rustbox

Rust implementation of the termbox library
MIT License
469 stars 48 forks source link

Use a structure for initialization options #22

Closed Stebalien closed 9 years ago

Stebalien commented 9 years ago

This commit also changes the error type returned from RustBox::init to match the new options structure and replaces the boxed Error with an IoError (because this is the only error that can occur).

Using structures for initialization options is more idiomatic (this is what rustc tends to do). Unfortunately, I had to make several unrelated changes in this commit to get a reasonable error type. I can split this into multiple commits but I'd rather not go though the hassle.

pythonesque commented 9 years ago

Yeah, I was thinking about this. I had initially made it an array because I had envisioned potentially passing in several different file descriptors, but that can really just be its own struct member if we ever want to do that.

gchp commented 9 years ago

Looks good to me, thank you!

gchp commented 9 years ago

Just released 0.3.0 which contains this change.

pythonesque commented 9 years ago

Note that the README.md file should also be updated (but that doesn't need its own release version).

gchp commented 9 years ago

@pythonesque just updated. Thanks for the reminder!