@@ -55,8 +55,8 @@ pub struct FieldOffset<T, U, PinFlag = NotPinned>(
55
55
PhantomData < ( PhantomContra < T > , U , PinFlag ) > ,
56
56
) ;
57
57
58
- /// `fn` cannot appear dirrectly in a type that need to be const.
59
- /// Workaround that with an indiretion
58
+ /// `fn` cannot appear directly in a type that need to be const.
59
+ /// Workaround that with an indirection
60
60
struct PhantomContra < T > ( fn ( T ) ) ;
61
61
62
62
/// Type that can be used in the `PinFlag` parameter of `FieldOffset` to specify that
@@ -329,7 +329,7 @@ impl<T, U, Flag> Clone for FieldOffset<T, U, Flag> {
329
329
330
330
/// This macro allows safe construction of a FieldOffset,
331
331
/// by generating a known to be valid lambda to pass to the
332
- /// constructor. It takes a type and the identifier of a field
332
+ /// constructor. It takes a type, and the identifier of a field
333
333
/// within that type as input.
334
334
///
335
335
/// Examples:
@@ -407,15 +407,15 @@ mod tests {
407
407
// Apply the pointer to get at `b` and read it
408
408
{
409
409
let y = foo_b. apply ( & x) ;
410
- assert ! ( * y == 2.0 ) ;
410
+ assert_eq ! ( * y, 2.0 ) ;
411
411
}
412
412
413
413
// Apply the pointer to get at `b` and mutate it
414
414
{
415
415
let y = foo_b. apply_mut ( & mut x) ;
416
416
* y = 42.0 ;
417
417
}
418
- assert ! ( x. b == 42.0 ) ;
418
+ assert_eq ! ( x. b, 42.0 ) ;
419
419
}
420
420
421
421
#[ test]
@@ -429,15 +429,15 @@ mod tests {
429
429
// Apply the pointer to get at `b` and read it
430
430
{
431
431
let y = tuple_1. apply ( & x) ;
432
- assert ! ( * y == 42.0 ) ;
432
+ assert_eq ! ( * y, 42.0 ) ;
433
433
}
434
434
435
435
// Apply the pointer to get at `b` and mutate it
436
436
{
437
437
let y = tuple_1. apply_mut ( & mut x) ;
438
438
* y = 5.0 ;
439
439
}
440
- assert ! ( x. 1 == 5.0 ) ;
440
+ assert_eq ! ( x. 1 , 5.0 ) ;
441
441
}
442
442
443
443
#[ test]
@@ -460,7 +460,7 @@ mod tests {
460
460
let y = bar_y_b. apply_mut ( & mut x) ;
461
461
* y = 42.0 ;
462
462
}
463
- assert ! ( x. y. b == 42.0 ) ;
463
+ assert_eq ! ( x. y. b, 42.0 ) ;
464
464
}
465
465
466
466
struct Parameterized < T , U > {
@@ -508,7 +508,7 @@ mod tests {
508
508
c : true ,
509
509
} ) ;
510
510
let pb: Pin < & f64 > = foo_b_pin. apply_pin ( foo. as_ref ( ) ) ;
511
- assert ! ( * pb == 22.0 ) ;
511
+ assert_eq ! ( * pb, 22.0 ) ;
512
512
513
513
let mut x = Box :: pin ( Bar {
514
514
x : 0 ,
@@ -523,6 +523,6 @@ mod tests {
523
523
524
524
let bar_y_pin = unsafe { offset_of ! ( Bar => y) . as_pinned_projection ( ) } ;
525
525
* ( bar_y_pin + foo_b_pin) . apply_pin_mut ( x. as_mut ( ) ) = 12. ;
526
- assert ! ( x. y. b == 12.0 ) ;
526
+ assert_eq ! ( x. y. b, 12.0 ) ;
527
527
}
528
528
}
0 commit comments