Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Format code using 'cargo fmt' #74

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 18 additions & 7 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -381,7 +381,9 @@ impl<T> SliceDeque<T> {
/// `elems` the elements of this `SliceDeque`.
#[inline]
pub unsafe fn from_raw_parts(
ptr: *mut T, capacity: usize, elems: &mut [T],
ptr: *mut T,
capacity: usize,
elems: &mut [T],
) -> Self {
let begin = elems.as_mut_ptr();
debug_assert!(in_bounds(slice::from_raw_parts(ptr, capacity), begin));
Expand Down Expand Up @@ -549,7 +551,8 @@ impl<T> SliceDeque<T> {
/// Panics if the new capacity overflows `usize`.
#[inline]
pub fn try_reserve(
&mut self, additional: usize,
&mut self,
additional: usize,
) -> Result<(), AllocError> {
let old_len = self.len();
let new_cap = self.grow_policy(additional);
Expand All @@ -575,7 +578,8 @@ impl<T> SliceDeque<T> {
/// if the capacity is already sufficient.
#[inline]
fn reserve_capacity(
&mut self, new_capacity: usize,
&mut self,
new_capacity: usize,
) -> Result<(), AllocError> {
unsafe {
if new_capacity <= self.capacity() {
Expand Down Expand Up @@ -1767,7 +1771,9 @@ impl<T> SliceDeque<T> {
/// ```
#[inline]
pub fn splice<R, I>(
&mut self, range: R, replace_with: I,
&mut self,
range: R,
replace_with: I,
) -> Splice<I::IntoIter>
where
R: ops::RangeBounds<usize>,
Expand Down Expand Up @@ -2953,7 +2959,8 @@ impl<'a, T> Drain<'a, T> {
/// `replace_with` iterator. Return whether we filled the entire
/// range. (`replace_with.next()` didn’t return `None`.)
unsafe fn fill<I: Iterator<Item = T>>(
&mut self, replace_with: &mut I,
&mut self,
replace_with: &mut I,
) -> bool {
let deq = self.deq.as_mut();
let range_start = deq.len();
Expand Down Expand Up @@ -3191,7 +3198,8 @@ mod tests {
}

fn constant_deque<T: Clone + fmt::Debug>(
size: usize, val: &T,
size: usize,
val: &T,
) -> SliceDeque<T> {
let mut v: SliceDeque<T> = SliceDeque::with_capacity(size);
for i in 0..size {
Expand Down Expand Up @@ -4503,7 +4511,10 @@ mod tests {

#[cfg(test)]
fn vecdeque_parameterized<T: Clone + PartialEq + fmt::Debug>(
a: T, b: T, c: T, d: T,
a: T,
b: T,
c: T,
d: T,
) {
let mut deq = SliceDeque::new();
assert_eq!(deq.len(), 0);
Expand Down
4 changes: 3 additions & 1 deletion src/mirrored/winapi.rs
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,9 @@ fn reserve_virtual_memory(size: usize) -> Result<(*mut u8), AllocError> {
/// If `file_mapping` or `address` are null, or if `size` is zero or not a
/// multiple of the allocation granularity of the system.
unsafe fn map_view_of_file(
file_mapping: HANDLE, size: usize, address: *mut u8,
file_mapping: HANDLE,
size: usize,
address: *mut u8,
) -> Result<(), ()> {
assert!(!file_mapping.is_null());
assert!(!address.is_null());
Expand Down