Can’t move out of BString using `into` methods
- Dominant language
- Rust
- Stars
- 1.1k
- Forks
- 77
- PR merge metrics
- No merged PRs in 30d
Description
Because `ByteVec` methods operate through deref on `BString`, it is impossible to use the ones with move semantics (`into_string` etc.) to move out of a `BString`, which is confusing.
```rust
use bstr::{BString, ByteVec};
fn main() {
let x = BString::from("hello world");
x.into_string_lossy(); // cannot move out of dereference of `BString`
}
```
Contributor guide
No contributing guide indexed for this repository
Research direction
Start by reading the BString and ByteVec definitions and the into_* methods involved in the example. Determine how the move-based methods are exposed through deref and what API behavior is intended. Done means the reported BString move operation works without the dereference error, with regression coverage for the example.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- api
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100