Skip to content

Commit f12ff19

Browse files
committed
std: minor whitespace cleanup
1 parent 4bc7672 commit f12ff19

File tree

9 files changed

+28
-34
lines changed

9 files changed

+28
-34
lines changed

src/libcollections/hashmap.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ fn resize_at(capacity: uint) -> uint {
9797
(capacity * 3) / 4
9898
}
9999

100-
impl<K:Hash + Eq,V> HashMap<K, V> {
100+
impl<K:Hash + Eq, V> HashMap<K, V> {
101101
#[inline]
102102
fn to_bucket(&self, h: uint) -> uint {
103103
// A good hash function with entropy spread over all of the

src/librustc/middle/trans/common.rs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -722,7 +722,7 @@ pub fn is_null(val: ValueRef) -> bool {
722722
}
723723

724724
// Used to identify cached monomorphized functions and vtables
725-
#[deriving(Eq,Hash)]
725+
#[deriving(Eq, Hash)]
726726
pub enum mono_param_id {
727727
mono_precise(ty::t, Option<@~[mono_id]>),
728728
mono_any,
@@ -732,7 +732,7 @@ pub enum mono_param_id {
732732
datum::RvalueMode),
733733
}
734734

735-
#[deriving(Eq,Hash)]
735+
#[deriving(Eq, Hash)]
736736
pub enum MonoDataClass {
737737
MonoBits, // Anything not treated differently from arbitrary integer data
738738
MonoNonNull, // Non-null pointers (used for optional-pointer optimization)
@@ -754,8 +754,7 @@ pub fn mono_data_classify(t: ty::t) -> MonoDataClass {
754754
}
755755
}
756756

757-
758-
#[deriving(Eq,Hash)]
757+
#[deriving(Eq, Hash)]
759758
pub struct mono_id_ {
760759
def: ast::DefId,
761760
params: ~[mono_param_id]

src/librustc/middle/ty.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ pub struct field_ty {
150150

151151
// Contains information needed to resolve types and (in the future) look up
152152
// the types of AST nodes.
153-
#[deriving(Eq,Hash)]
153+
#[deriving(Eq, Hash)]
154154
pub struct creader_cache_key {
155155
cnum: CrateNum,
156156
pos: uint,

src/libstd/io/net/ip.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,6 @@ pub struct SocketAddr {
5555
port: Port,
5656
}
5757

58-
5958
impl fmt::Show for SocketAddr {
6059
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
6160
match self.ip {

src/libstd/lib.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,6 @@ pub mod container;
149149
pub mod default;
150150
pub mod any;
151151

152-
153152
/* Common data structures */
154153

155154
pub mod option;

src/libsyntax/ast.rs

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ pub struct SCTable {
107107
pub static EMPTY_CTXT : SyntaxContext = 0;
108108
pub static ILLEGAL_CTXT : SyntaxContext = 1;
109109

110-
#[deriving(Eq, Encodable, Decodable,Hash)]
110+
#[deriving(Eq, Encodable, Decodable, Hash)]
111111
pub enum SyntaxContext_ {
112112
EmptyCtxt,
113113
Mark (Mrk,SyntaxContext),
@@ -332,7 +332,7 @@ impl Eq for MetaItem_ {
332332
}
333333
}
334334

335-
#[deriving(Clone, Eq, Encodable, Decodable,Hash)]
335+
#[deriving(Clone, Eq, Encodable, Decodable, Hash)]
336336
pub struct Block {
337337
view_items: ~[ViewItem],
338338
stmts: ~[@Stmt],
@@ -467,7 +467,7 @@ pub enum Stmt_ {
467467
// FIXME (pending discussion of #1697, #2178...): local should really be
468468
// a refinement on pat.
469469
/// Local represents a `let` statement, e.g., `let <pat>:<ty> = <expr>;`
470-
#[deriving(Eq, Encodable, Decodable,Hash)]
470+
#[deriving(Eq, Encodable, Decodable, Hash)]
471471
pub struct Local {
472472
ty: P<Ty>,
473473
pat: @Pat,
@@ -478,7 +478,7 @@ pub struct Local {
478478

479479
pub type Decl = Spanned<Decl_>;
480480

481-
#[deriving(Eq, Encodable, Decodable,Hash)]
481+
#[deriving(Eq, Encodable, Decodable, Hash)]
482482
pub enum Decl_ {
483483
// a local (let) binding:
484484
DeclLocal(@Local),
@@ -514,7 +514,7 @@ pub enum UnsafeSource {
514514
UserProvided,
515515
}
516516

517-
#[deriving(Clone, Eq, Encodable, Decodable,Hash)]
517+
#[deriving(Clone, Eq, Encodable, Decodable, Hash)]
518518
pub struct Expr {
519519
id: NodeId,
520520
node: Expr_,
@@ -732,7 +732,7 @@ pub struct MutTy {
732732
mutbl: Mutability,
733733
}
734734

735-
#[deriving(Eq, Encodable, Decodable,Hash)]
735+
#[deriving(Eq, Encodable, Decodable, Hash)]
736736
pub struct TypeField {
737737
ident: Ident,
738738
mt: MutTy,
@@ -836,7 +836,7 @@ impl fmt::Show for Onceness {
836836
}
837837
}
838838

839-
#[deriving(Eq, Encodable, Decodable,Hash)]
839+
#[deriving(Eq, Encodable, Decodable, Hash)]
840840
pub struct ClosureTy {
841841
sigil: Sigil,
842842
region: Option<Lifetime>,
@@ -967,7 +967,7 @@ pub enum ExplicitSelf_ {
967967

968968
pub type ExplicitSelf = Spanned<ExplicitSelf_>;
969969

970-
#[deriving(Eq, Encodable, Decodable,Hash)]
970+
#[deriving(Eq, Encodable, Decodable, Hash)]
971971
pub struct Method {
972972
ident: Ident,
973973
attrs: ~[Attribute],
@@ -987,7 +987,7 @@ pub struct Mod {
987987
items: ~[@Item],
988988
}
989989

990-
#[deriving(Clone, Eq, Encodable, Decodable,Hash)]
990+
#[deriving(Clone, Eq, Encodable, Decodable, Hash)]
991991
pub struct ForeignMod {
992992
abis: AbiSet,
993993
view_items: ~[ViewItem],
@@ -1074,14 +1074,14 @@ pub type Attribute = Spanned<Attribute_>;
10741074
// Distinguishes between Attributes that decorate items and Attributes that
10751075
// are contained as statements within items. These two cases need to be
10761076
// distinguished for pretty-printing.
1077-
#[deriving(Clone, Eq, Encodable, Decodable,Hash)]
1077+
#[deriving(Clone, Eq, Encodable, Decodable, Hash)]
10781078
pub enum AttrStyle {
10791079
AttrOuter,
10801080
AttrInner,
10811081
}
10821082

10831083
// doc-comments are promoted to attributes that have is_sugared_doc = true
1084-
#[deriving(Clone, Eq, Encodable, Decodable,Hash)]
1084+
#[deriving(Clone, Eq, Encodable, Decodable, Hash)]
10851085
pub struct Attribute_ {
10861086
style: AttrStyle,
10871087
value: @MetaItem,
@@ -1095,13 +1095,13 @@ pub struct Attribute_ {
10951095
If this impl is an ItemImpl, the impl_id is redundant (it could be the
10961096
same as the impl's node id).
10971097
*/
1098-
#[deriving(Clone, Eq, Encodable, Decodable,Hash)]
1098+
#[deriving(Clone, Eq, Encodable, Decodable, Hash)]
10991099
pub struct TraitRef {
11001100
path: Path,
11011101
ref_id: NodeId,
11021102
}
11031103

1104-
#[deriving(Clone, Eq, Encodable, Decodable,Hash)]
1104+
#[deriving(Clone, Eq, Encodable, Decodable, Hash)]
11051105
pub enum Visibility {
11061106
Public,
11071107
Private,
@@ -1117,7 +1117,7 @@ impl Visibility {
11171117
}
11181118
}
11191119

1120-
#[deriving(Clone, Eq, Encodable, Decodable,Hash)]
1120+
#[deriving(Clone, Eq, Encodable, Decodable, Hash)]
11211121
pub struct StructField_ {
11221122
kind: StructFieldKind,
11231123
id: NodeId,
@@ -1127,13 +1127,13 @@ pub struct StructField_ {
11271127

11281128
pub type StructField = Spanned<StructField_>;
11291129

1130-
#[deriving(Clone, Eq, Encodable, Decodable,Hash)]
1130+
#[deriving(Clone, Eq, Encodable, Decodable, Hash)]
11311131
pub enum StructFieldKind {
11321132
NamedField(Ident, Visibility),
11331133
UnnamedField // element of a tuple-like struct
11341134
}
11351135

1136-
#[deriving(Eq, Encodable, Decodable,Hash)]
1136+
#[deriving(Eq, Encodable, Decodable, Hash)]
11371137
pub struct StructDef {
11381138
fields: ~[StructField], /* fields, not including ctor */
11391139
/* ID of the constructor. This is only used for tuple- or enum-like
@@ -1173,7 +1173,7 @@ pub enum Item_ {
11731173
ItemMac(Mac),
11741174
}
11751175

1176-
#[deriving(Eq, Encodable, Decodable,Hash)]
1176+
#[deriving(Eq, Encodable, Decodable, Hash)]
11771177
pub struct ForeignItem {
11781178
ident: Ident,
11791179
attrs: ~[Attribute],
@@ -1183,7 +1183,7 @@ pub struct ForeignItem {
11831183
vis: Visibility,
11841184
}
11851185

1186-
#[deriving(Eq, Encodable, Decodable,Hash)]
1186+
#[deriving(Eq, Encodable, Decodable, Hash)]
11871187
pub enum ForeignItem_ {
11881188
ForeignItemFn(P<FnDecl>, Generics),
11891189
ForeignItemStatic(P<Ty>, /* is_mutbl */ bool),
@@ -1192,7 +1192,7 @@ pub enum ForeignItem_ {
11921192
// The data we save and restore about an inlined item or method. This is not
11931193
// part of the AST that we parse from a file, but it becomes part of the tree
11941194
// that we trans.
1195-
#[deriving(Eq, Encodable, Decodable,Hash)]
1195+
#[deriving(Eq, Encodable, Decodable, Hash)]
11961196
pub enum InlinedItem {
11971197
IIItem(@Item),
11981198
IIMethod(DefId /* impl id */, bool /* is provided */, @Method),

src/libsyntax/codemap.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ pub struct BytePos(u32);
3838
/// A character offset. Because of multibyte utf8 characters, a byte offset
3939
/// is not equivalent to a character offset. The CodeMap will convert BytePos
4040
/// values to CharPos values as necessary.
41-
#[deriving(Eq,Hash, Ord)]
41+
#[deriving(Eq, Hash, Ord)]
4242
pub struct CharPos(uint);
4343

4444
// FIXME: Lots of boilerplate in these impls, but so far my attempts to fix

src/libsyntax/util/interner.rs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -75,8 +75,7 @@ impl<T:Eq + Hash + Freeze + Clone + 'static> Interner<T> {
7575
vect.get().len()
7676
}
7777

78-
pub fn find_equiv<Q:Hash + Equiv<T>>(&self, val: &Q)
79-
-> Option<Name> {
78+
pub fn find_equiv<Q:Hash + Equiv<T>>(&self, val: &Q) -> Option<Name> {
8079
let map = self.map.borrow();
8180
match map.get().find_equiv(val) {
8281
Some(v) => Some(*v),
@@ -207,8 +206,7 @@ impl StrInterner {
207206
vect.get().len()
208207
}
209208

210-
pub fn find_equiv<Q:Hash + Equiv<RcStr>>(&self, val: &Q)
211-
-> Option<Name> {
209+
pub fn find_equiv<Q:Hash + Equiv<RcStr>>(&self, val: &Q) -> Option<Name> {
212210
let map = self.map.borrow();
213211
match map.get().find_equiv(val) {
214212
Some(v) => Some(*v),

src/test/run-pass/deriving-via-extension-type-params.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,7 @@
1010
// option. This file may not be copied, modified, or distributed
1111
// except according to those terms.
1212

13-
#[deriving(Eq)]
14-
#[deriving(Hash)]
13+
#[deriving(Eq, Hash)]
1514
struct Foo<T> {
1615
x: int,
1716
y: T,

0 commit comments

Comments
 (0)