@@ -288,15 +288,15 @@ impl AtomicBool {
288
288
/// ```
289
289
/// use std::sync::atomics::{AtomicBool, SeqCst};
290
290
///
291
- /// let mut foo = AtomicBool::new(true);
291
+ /// let foo = AtomicBool::new(true);
292
292
/// assert_eq!(true, foo.fetch_and(false, SeqCst));
293
293
/// assert_eq!(false, foo.load(SeqCst));
294
294
///
295
- /// let mut foo = AtomicBool::new(true);
295
+ /// let foo = AtomicBool::new(true);
296
296
/// assert_eq!(true, foo.fetch_and(true, SeqCst));
297
297
/// assert_eq!(true, foo.load(SeqCst));
298
298
///
299
- /// let mut foo = AtomicBool::new(false);
299
+ /// let foo = AtomicBool::new(false);
300
300
/// assert_eq!(false, foo.fetch_and(false, SeqCst));
301
301
/// assert_eq!(false, foo.load(SeqCst));
302
302
/// ```
@@ -318,16 +318,16 @@ impl AtomicBool {
318
318
/// ```
319
319
/// use std::sync::atomics::{AtomicBool, SeqCst};
320
320
///
321
- /// let mut foo = AtomicBool::new(true);
321
+ /// let foo = AtomicBool::new(true);
322
322
/// assert_eq!(true, foo.fetch_nand(false, SeqCst));
323
323
/// assert_eq!(true, foo.load(SeqCst));
324
324
///
325
- /// let mut foo = AtomicBool::new(true);
325
+ /// let foo = AtomicBool::new(true);
326
326
/// assert_eq!(true, foo.fetch_nand(true, SeqCst));
327
327
/// assert_eq!(0, foo.load(SeqCst) as int);
328
328
/// assert_eq!(false, foo.load(SeqCst));
329
329
///
330
- /// let mut foo = AtomicBool::new(false);
330
+ /// let foo = AtomicBool::new(false);
331
331
/// assert_eq!(false, foo.fetch_nand(false, SeqCst));
332
332
/// assert_eq!(true, foo.load(SeqCst));
333
333
/// ```
@@ -349,15 +349,15 @@ impl AtomicBool {
349
349
/// ```
350
350
/// use std::sync::atomics::{AtomicBool, SeqCst};
351
351
///
352
- /// let mut foo = AtomicBool::new(true);
352
+ /// let foo = AtomicBool::new(true);
353
353
/// assert_eq!(true, foo.fetch_or(false, SeqCst));
354
354
/// assert_eq!(true, foo.load(SeqCst));
355
355
///
356
- /// let mut foo = AtomicBool::new(true);
356
+ /// let foo = AtomicBool::new(true);
357
357
/// assert_eq!(true, foo.fetch_or(true, SeqCst));
358
358
/// assert_eq!(true, foo.load(SeqCst));
359
359
///
360
- /// let mut foo = AtomicBool::new(false);
360
+ /// let foo = AtomicBool::new(false);
361
361
/// assert_eq!(false, foo.fetch_or(false, SeqCst));
362
362
/// assert_eq!(false, foo.load(SeqCst));
363
363
/// ```
@@ -379,15 +379,15 @@ impl AtomicBool {
379
379
/// ```
380
380
/// use std::sync::atomics::{AtomicBool, SeqCst};
381
381
///
382
- /// let mut foo = AtomicBool::new(true);
382
+ /// let foo = AtomicBool::new(true);
383
383
/// assert_eq!(true, foo.fetch_xor(false, SeqCst));
384
384
/// assert_eq!(true, foo.load(SeqCst));
385
385
///
386
- /// let mut foo = AtomicBool::new(true);
386
+ /// let foo = AtomicBool::new(true);
387
387
/// assert_eq!(true, foo.fetch_xor(true, SeqCst));
388
388
/// assert_eq!(false, foo.load(SeqCst));
389
389
///
390
- /// let mut foo = AtomicBool::new(false);
390
+ /// let foo = AtomicBool::new(false);
391
391
/// assert_eq!(false, foo.fetch_xor(false, SeqCst));
392
392
/// assert_eq!(false, foo.load(SeqCst));
393
393
/// ```
@@ -440,7 +440,7 @@ impl AtomicInt {
440
440
/// ```
441
441
/// use std::sync::atomics::{AtomicInt, SeqCst};
442
442
///
443
- /// let mut foo = AtomicInt::new(0);
443
+ /// let foo = AtomicInt::new(0);
444
444
/// assert_eq!(0, foo.fetch_add(10, SeqCst));
445
445
/// assert_eq!(10, foo.load(SeqCst));
446
446
/// ```
@@ -456,7 +456,7 @@ impl AtomicInt {
456
456
/// ```
457
457
/// use std::sync::atomics::{AtomicInt, SeqCst};
458
458
///
459
- /// let mut foo = AtomicInt::new(0);
459
+ /// let foo = AtomicInt::new(0);
460
460
/// assert_eq!(0, foo.fetch_sub(10, SeqCst));
461
461
/// assert_eq!(-10, foo.load(SeqCst));
462
462
/// ```
@@ -507,7 +507,7 @@ impl AtomicUint {
507
507
/// ```
508
508
/// use std::sync::atomics::{AtomicUint, SeqCst};
509
509
///
510
- /// let mut foo = AtomicUint::new(0);
510
+ /// let foo = AtomicUint::new(0);
511
511
/// assert_eq!(0, foo.fetch_add(10, SeqCst));
512
512
/// assert_eq!(10, foo.load(SeqCst));
513
513
/// ```
@@ -523,7 +523,7 @@ impl AtomicUint {
523
523
/// ```
524
524
/// use std::sync::atomics::{AtomicUint, SeqCst};
525
525
///
526
- /// let mut foo = AtomicUint::new(10);
526
+ /// let foo = AtomicUint::new(10);
527
527
/// assert_eq!(10, foo.fetch_sub(10, SeqCst));
528
528
/// assert_eq!(0, foo.load(SeqCst));
529
529
/// ```
@@ -790,7 +790,7 @@ mod test {
790
790
791
791
#[ test]
792
792
fn bool_ ( ) {
793
- let mut a = AtomicBool :: new ( false ) ;
793
+ let a = AtomicBool :: new ( false ) ;
794
794
assert_eq ! ( a. compare_and_swap( false , true , SeqCst ) , false ) ;
795
795
assert_eq ! ( a. compare_and_swap( false , true , SeqCst ) , true ) ;
796
796
@@ -800,13 +800,13 @@ mod test {
800
800
801
801
#[ test]
802
802
fn option_empty ( ) {
803
- let mut option: AtomicOption < ( ) > = AtomicOption :: empty ( ) ;
803
+ let option: AtomicOption < ( ) > = AtomicOption :: empty ( ) ;
804
804
assert ! ( option. is_empty( SeqCst ) ) ;
805
805
}
806
806
807
807
#[ test]
808
808
fn option_swap ( ) {
809
- let mut p = AtomicOption :: new ( ~1 ) ;
809
+ let p = AtomicOption :: new ( ~1 ) ;
810
810
let a = ~2 ;
811
811
812
812
let b = p. swap ( a, SeqCst ) ;
@@ -817,7 +817,7 @@ mod test {
817
817
818
818
#[ test]
819
819
fn option_take ( ) {
820
- let mut p = AtomicOption :: new ( ~1 ) ;
820
+ let p = AtomicOption :: new ( ~1 ) ;
821
821
822
822
assert_eq ! ( p. take( SeqCst ) , Some ( ~1 ) ) ;
823
823
assert_eq ! ( p. take( SeqCst ) , None ) ;
@@ -830,7 +830,7 @@ mod test {
830
830
831
831
#[ test]
832
832
fn option_fill ( ) {
833
- let mut p = AtomicOption :: new ( ~1 ) ;
833
+ let p = AtomicOption :: new ( ~1 ) ;
834
834
assert ! ( p. fill( ~2 , SeqCst ) . is_some( ) ) ; // should fail; shouldn't leak!
835
835
assert_eq ! ( p. take( SeqCst ) , Some ( ~1 ) ) ;
836
836
@@ -840,7 +840,7 @@ mod test {
840
840
841
841
#[ test]
842
842
fn bool_and ( ) {
843
- let mut a = AtomicBool :: new ( true ) ;
843
+ let a = AtomicBool :: new ( true ) ;
844
844
assert_eq ! ( a. fetch_and( false , SeqCst ) , true ) ;
845
845
assert_eq ! ( a. load( SeqCst ) , false ) ;
846
846
}
@@ -867,7 +867,7 @@ mod test {
867
867
let mut slot = 0u8 ;
868
868
assert_eq ! ( super :: atomic_compare_and_swap( & mut slot, 1 , 2 , SeqCst ) , 0 ) ;
869
869
870
- let mut slot = 0u32 ;
870
+ let slot = 0u32 ;
871
871
assert_eq ! ( super :: atomic_load( & slot, SeqCst ) , 0 ) ;
872
872
873
873
let mut slot = 0u64 ;
0 commit comments