Skip to content

Commit

Permalink
inout: release v0.1.3 (#756)
Browse files Browse the repository at this point in the history
  • Loading branch information
newpavlov authored Mar 31, 2022
1 parent aa6bb32 commit 81ef0b0
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 14 deletions.
6 changes: 6 additions & 0 deletions inout/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,12 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## 0.1.3 (2022-03-31)
### Fixed
- MIRI error in `From` impl for `InOutBuf` ([#755])

[#755]: https://github.com/RustCrypto/utils/pull/755

## 0.1.2 (2022-02-10)
### Changed
- Use borrow instead of consuming in `InOutBufReserved::get_*_len()` methods ([#734])
Expand Down
2 changes: 1 addition & 1 deletion inout/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "inout"
version = "0.1.2" # Also update html_root_url in lib.rs when bumping this
version = "0.1.3" # Also update html_root_url in lib.rs when bumping this
description = "Custom reference types for code generic over in-place and buffer-to-buffer modes of operation."
authors = ["RustCrypto Developers"]
license = "MIT OR Apache-2.0"
Expand Down
6 changes: 3 additions & 3 deletions inout/src/inout.rs
Original file line number Diff line number Diff line change
Expand Up @@ -78,10 +78,10 @@ impl<'inp, 'out, T: Clone> InOut<'inp, 'out, T> {
impl<'a, T> From<&'a mut T> for InOut<'a, 'a, T> {
#[inline(always)]
fn from(val: &'a mut T) -> Self {
let out_ptr = val as *mut T;
let p = val as *mut T;
Self {
in_ptr: out_ptr as *const T,
out_ptr,
in_ptr: p,
out_ptr: p,
_pd: PhantomData,
}
}
Expand Down
12 changes: 6 additions & 6 deletions inout/src/inout_buf.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@ pub struct InOutBuf<'inp, 'out, T> {
impl<'a, T> From<&'a mut [T]> for InOutBuf<'a, 'a, T> {
#[inline(always)]
fn from(buf: &'a mut [T]) -> Self {
let out_ptr = buf.as_mut_ptr();
let p = buf.as_mut_ptr();
Self {
in_ptr: out_ptr,
out_ptr: out_ptr,
in_ptr: p,
out_ptr: p,
len: buf.len(),
_pd: PhantomData,
}
Expand All @@ -32,10 +32,10 @@ impl<'a, T> InOutBuf<'a, 'a, T> {
/// Create `InOutBuf` from a single mutable reference.
#[inline(always)]
pub fn from_mut(val: &'a mut T) -> InOutBuf<'a, 'a, T> {
let out_ptr = val as *mut T;
let p = val as *mut T;
Self {
in_ptr: out_ptr as *const T,
out_ptr,
in_ptr: p,
out_ptr: p,
len: 1,
_pd: PhantomData,
}
Expand Down
2 changes: 1 addition & 1 deletion inout/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
#![doc(
html_logo_url = "https://raw.githubusercontent.com/RustCrypto/media/8f1a9894/logo.svg",
html_favicon_url = "https://raw.githubusercontent.com/RustCrypto/media/8f1a9894/logo.svg",
html_root_url = "https://docs.rs/inout/0.1.2"
html_root_url = "https://docs.rs/inout/0.1.3"
)]
#![allow(clippy::needless_lifetimes)]
#![cfg_attr(docsrs, feature(doc_cfg))]
Expand Down
6 changes: 3 additions & 3 deletions inout/src/reserved.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,11 @@ impl<'a, T> InOutBufReserved<'a, 'a, T> {
if msg_len > buf.len() {
return Err(OutIsTooSmallError);
}
let out_ptr = buf.as_mut_ptr();
let p = buf.as_mut_ptr();
let out_len = buf.len();
Ok(Self {
in_ptr: out_ptr as *const T,
out_ptr,
in_ptr: p,
out_ptr: p,
in_len: msg_len,
out_len,
_pd: PhantomData,
Expand Down

0 comments on commit 81ef0b0

Please sign in to comment.