Skip to content
This repository was archived by the owner on Mar 27, 2024. It is now read-only.

Conversation

@PieterPenninckx
Copy link
Contributor

Fixes #73.

unsafe { slice::from_raw_parts(self.bufs[i], self.samples) }
}

/// Mutably access channel at the given index, unchecked
Copy link
Contributor Author

@PieterPenninckx PieterPenninckx Nov 2, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure why the documentation states "unchecked" (same for the get method).

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Indeed. With the types in place, there doesn't seem to be anything unchecked about this. Giving an out-of-bounds index will panic, as it should.

Same thing goes for get in Inputs.

@crsaracco crsaracco mentioned this pull request Nov 3, 2019
13 tasks
Copy link
Contributor

@askeksa askeksa left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Change looks good. I suggest removing , unchecked in the three places it occurs.

unsafe { slice::from_raw_parts(self.bufs[i], self.samples) }
}

/// Mutably access channel at the given index, unchecked
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Indeed. With the types in place, there doesn't seem to be anything unchecked about this. Giving an out-of-bounds index will panic, as it should.

Same thing goes for get in Inputs.

@askeksa askeksa merged commit b689dfb into RustAudio:master Nov 4, 2019
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.

get_mut method on Outputs allows for creating multiple refererences as mutable to the same data

3 participants