Skip to content
This repository has been archived by the owner on Feb 14, 2023. It is now read-only.

Add Buffer::resize and Buffer::truncate. #16

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

oblique
Copy link

@oblique oblique commented Sep 14, 2019

These methods enable users to use Buffer without having an intermediate array.

For example:

let mut buffer = Buffer::with_capacity(1024);
buffer.resize(1024, 0);
let len = fill_some_data(buffer.buf_mut());
buffer.truncate(len);

These methods enable users to use `Buffer` without having an intermediate
array.

For example:

```
let mut buffer = Buffer::with_capacity(1024);
buffer.resize(1024, 0);
let len = fill_some_data(buffer.buf_mut());
buffer.truncate(len);
```
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant