Skip to content

Commit

Permalink
address comment
Browse files Browse the repository at this point in the history
  • Loading branch information
vnghia committed Mar 18, 2024
1 parent e34a83a commit e794362
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/avformat/avio.rs
Original file line number Diff line number Diff line change
Expand Up @@ -155,11 +155,16 @@ impl AVIOContextCustom {
}
}

// Extract the data passed in `alloc_context`
// and set that data inside it to an empty vec.
/// Re-take the ownership of the `data` passed in `alloc_context`.
/// The `data` inside this will be set to an empty vector.
pub fn take_data(&mut self) -> Vec<u8> {
std::mem::take(&mut self._opaque.data)
}

/// Get a mutable reference to the data inside this context.
fn as_mut_data(&mut self) -> &mut Vec<u8> {
&mut self._opaque.data
}
}

impl Drop for AVIOContextCustom {
Expand Down

0 comments on commit e794362

Please sign in to comment.