Skip to content

Commit

Permalink
rust-themis: with_capacity -> try_reserve
Browse files Browse the repository at this point in the history
Because we don't have try_with_capacity or something similar.
  • Loading branch information
G1gg1L3s committed Jun 27, 2023
1 parent 1dee404 commit 24d4fd0
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/wrappers/themis/rust/src/secure_session.rs
Original file line number Diff line number Diff line change
Expand Up @@ -570,7 +570,8 @@ impl SecureSession {
/// [`negotiate`]: struct.SecureSession.html#method.negotiate
/// [`receive_data`]: trait.SecureSessionTransport.html#method.receive_data
pub fn receive(&mut self, max_len: usize) -> Result<Vec<u8>> {
let mut message = Vec::with_capacity(max_len);
let mut message = Vec::new();
message.try_reserve(max_len)?;

unsafe {
let length = secure_session_receive(
Expand Down

0 comments on commit 24d4fd0

Please sign in to comment.