Stebalien / term

A Rust library for terminfo parsing and terminal colors.
https://stebalien.github.io/doc/term/term/
Apache License 2.0
178 stars 49 forks source link

Port to new io #20

Closed Stebalien closed 9 years ago

Stebalien commented 9 years ago

This is a port to the new io, fs, and path modules AND SHOULD NOT BE MERGED YET. I'm posting it now for feedback (and because I wanted to test out the new io API).

  1. Is relying on a third party library, byteorder, ok?
  2. I currently re-use PathBufs. Should I just reallocate new ones?

Somewhat off topic (should I put these on internals?):

  1. Is OsStr/OsString likely to gain a split method? Currently, term can't handle non-utf8 TERMINFO paths because because I couldn't replace env::var with env::var_os because I needed Str::split.
  2. Will ReadExt likely gain a method like the read_harder that I defined here? The byte-order crate also implements a similar method.
rust-highfive commented 9 years ago

r? @alexcrichton

(rust_highfive has picked a reviewer for you, use r? to override)

alexcrichton commented 9 years ago

Is relying on a third party library, byteorder, ok?

Yes that's fine. I would personally probably just rewrite the few helpers we need, but it's fine either way.

I currently re-use PathBufs. Should I just reallocate new ones?

Yeah that's ok.

Is OsStr/OsString likely to gain a split method?

Perhaps, probably not soon though.

Will ReadExt likely gain a method like the read_harder that I defined here?

I suspect so, it's being tracked by https://github.com/rust-lang/rust/issues/23174

Stebalien commented 9 years ago

The only problem left (other than io stability) is rust-lang/rust#22888. Would you like me to sqash?

Stebalien commented 9 years ago

Given that old_io is now deprecated, I feel that it's reasonable to merge this. There's still a TODO that can be fixed when the bug mentioned above is fixed and the byteorder crate does ignore interrupts.

alexcrichton commented 9 years ago

Oops, thanks for the reminder!