Skip to content

Commit

Permalink
Update src/liballoc/vec.rs
Browse files Browse the repository at this point in the history
Add @Centril's comment

Co-Authored-By: scottmcm <scottmcm@users.noreply.github.com>
  • Loading branch information
Centril and scottmcm committed Jan 3, 2019
1 parent ac642ab commit 61fb909
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/liballoc/vec.rs
Expand Up @@ -790,6 +790,10 @@ impl<T> Vec<T> {
/// // Per the FFI method's docs, "32768 bytes is always enough".
/// let mut dict = Vec::with_capacity(32_768);
/// let mut dict_length = 0;
/// // SAFETY: When `deflateGetDictionary` returns `Z_OK`, it holds that:
/// // 1. `dict_length` elements were initialized.
/// // 2. `dict_length` <= the capacity (32_768)
/// // which makes `set_len` safe to call.
/// unsafe {
/// // Make the FFI call...
/// let r = deflateGetDictionary(self.strm, dict.as_mut_ptr(), &mut dict_length);
Expand Down

0 comments on commit 61fb909

Please sign in to comment.