Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace buf_redux with BufReader from std #613

Merged
merged 1 commit into from
Apr 10, 2022
Merged

Replace buf_redux with BufReader from std #613

merged 1 commit into from
Apr 10, 2022

Conversation

lopopolo
Copy link
Contributor

rustyline depends on buf_redux for two calls to get_len, but these
calls can be replaced with calls to reader.buffer().len() using APIs
in std that have been available since Rust 1.37.0:

https://doc.rust-lang.org/std/io/struct.BufReader.html#method.buffer

std::io::BufReader::buffer does not cause any additional reads to
occur and exposes the internal buffered and unread contents of the
BufReader.

Motivation for this commit is reducing dependencies.

`rustyline` depends on `buf_redux` for two calls to `get_len`, but these
calls can be replaced with calls to `reader.buffer().len()` using APIs
in `std` that have been available since Rust 1.37.0:

https://doc.rust-lang.org/std/io/struct.BufReader.html#method.buffer

`std::io::BufReader::buffer` does not cause any additional reads to
occur and exposes the internal buffered and unread contents of the
`BufReader`.

Motivation for this commit is reducing dependencies.
@gwenn gwenn merged commit 507ffa2 into kkawakam:master Apr 10, 2022
@gwenn
Copy link
Collaborator

gwenn commented Apr 10, 2022

Indeed, thanks.

@lopopolo lopopolo deleted the lopopolo/remove-buf_redux-dep branch April 10, 2022 15:58
lopopolo added a commit to artichoke/artichoke that referenced this pull request Aug 2, 2022
`rustyline` 10.0.0 includes a breaking change where `Editor::new` now
returns result. The REPL propagates this error as an unhandled readline
error, which will exit the REPL with an error message.

This is a handcrafted version of @dependabot's PR in #1999 to address
this breaking change.

`rustyline` 10.0.0 includes several commits (a few of which I authored)
that reduce the number of deps pulled in a bunch:

- kkawakam/rustyline#613
- kkawakam/rustyline#614
- kkawakam/rustyline#615
- kkawakam/rustyline#623
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants