duesee / duesee/imap-codec

`escape_byte_string` could accept `B: IntoIterator<Item=u8>`

Open
#612 0 comments 2 reactions 0 assignees View on GitHub
enhancement good first issue
Dominant language
Rust
Stars
52
Forks
25
Avg merge
21h 53m
Merged PRs (30d)
2

Description

If we change the signature from

```rust
pub fn escape_byte_string(bytes: B) -> String
where
B: AsRef<[u8]>,
```
to
```rust
pub fn escape_byte_string(bytes: B) -> String
where
B: IntoIterator,
```
then we can pass more types to the function, e.g. `VecDeque`.

The implementation would not change much because we create an iterator anyway. Current implementation:

```rust
let bytes = bytes.as_ref();

bytes
.iter()
//...
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.