Update to rustfmt-preview (#348)

* Update to rustfmt-preview.

* Run "cargo fmt --all" with rustfmt 0.4.1.

rustfmt 0.4.1 is the latest release of rustfmt-preview available on the
stable channel.

* Fix a long line that rustfmt 0.4.1 can't handle.

* Remove unneeded commas left behind by rustfmt.
This commit is contained in:
Dan Gohman
2018-05-25 11:38:38 -07:00
committed by GitHub
parent 99f6055c55
commit 6b88cd44a8
137 changed files with 1914 additions and 2380 deletions

View File

@@ -33,19 +33,10 @@
#![warn(unused_import_braces)]
#![cfg_attr(feature = "std", warn(unstable_features))]
#![cfg_attr(feature = "clippy", plugin(clippy(conf_file = "../../clippy.toml")))]
#![cfg_attr(feature = "cargo-clippy", allow(new_without_default, new_without_default_derive))]
#![cfg_attr(feature = "cargo-clippy",
allow(new_without_default, new_without_default_derive))]
#![cfg_attr(feature="cargo-clippy", warn(
float_arithmetic,
mut_mut,
nonminimal_bool,
option_map_unwrap_or,
option_map_unwrap_or_else,
print_stdout,
unicode_not_nfc,
use_self,
))]
warn(float_arithmetic, mut_mut, nonminimal_bool, option_map_unwrap_or,
option_map_unwrap_or_else, print_stdout, unicode_not_nfc, use_self))]
// Turns on no_std and alloc features if std is not available.
#![cfg_attr(not(feature = "std"), no_std)]
#![cfg_attr(not(feature = "std"), feature(alloc))]

View File

@@ -1,10 +1,10 @@
//! Densely numbered entity references as mapping keys.
use {EntityRef, Iter, IterMut, Keys};
use std::marker::PhantomData;
use std::ops::{Index, IndexMut};
use std::slice;
use std::vec::Vec;
use {EntityRef, Iter, IterMut, Keys};
/// A mapping `K -> V` for densely indexed entity references.
///

View File

@@ -33,7 +33,11 @@ impl<T: ReservedValue> PackedOption<T> {
/// Expand the packed option into a normal `Option`.
pub fn expand(self) -> Option<T> {
if self.is_none() { None } else { Some(self.0) }
if self.is_none() {
None
} else {
Some(self.0)
}
}
/// Maps a `PackedOption<T>` to `Option<U>` by applying a function to a contained value.

View File

@@ -1,9 +1,9 @@
//! Densely numbered entity references as mapping keys.
use {EntityRef, Iter, IterMut, Keys};
use std::marker::PhantomData;
use std::ops::{Index, IndexMut};
use std::slice;
use std::vec::Vec;
use {EntityRef, Iter, IterMut, Keys};
/// A primary mapping `K -> V` allocating dense entity references.
///

View File

@@ -1,8 +1,8 @@
//! Densely numbered entity references as set keys.
use {EntityRef, Keys};
use std::marker::PhantomData;
use std::vec::Vec;
use {EntityRef, Keys};
/// A set of `K` for densely indexed entity references.
///

View File

@@ -7,11 +7,11 @@
//! > Briggs, Torczon, *An efficient representation for sparse sets*,
//! ACM Letters on Programming Languages and Systems, Volume 2, Issue 1-4, March-Dec. 1993.
use {EntityMap, EntityRef};
use std::mem;
use std::slice;
use std::u32;
use std::vec::Vec;
use {EntityMap, EntityRef};
/// Trait for extracting keys from values stored in a `SparseMap`.
///