Skip to content

Commit d3eabf8

Browse files
authored
Merge pull request Diggsey#20 from remilauzier/master
Fix some typo and warnings
2 parents 6375b0a + 25770b9 commit d3eabf8

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

src/lib.rs

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,8 @@ pub struct FieldOffset<T, U, PinFlag = NotPinned>(
5555
PhantomData<(PhantomContra<T>, U, PinFlag)>,
5656
);
5757

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
6060
struct PhantomContra<T>(fn(T));
6161

6262
/// 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> {
329329

330330
/// This macro allows safe construction of a FieldOffset,
331331
/// 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
333333
/// within that type as input.
334334
///
335335
/// Examples:
@@ -407,15 +407,15 @@ mod tests {
407407
// Apply the pointer to get at `b` and read it
408408
{
409409
let y = foo_b.apply(&x);
410-
assert!(*y == 2.0);
410+
assert_eq!(*y, 2.0);
411411
}
412412

413413
// Apply the pointer to get at `b` and mutate it
414414
{
415415
let y = foo_b.apply_mut(&mut x);
416416
*y = 42.0;
417417
}
418-
assert!(x.b == 42.0);
418+
assert_eq!(x.b, 42.0);
419419
}
420420

421421
#[test]
@@ -429,15 +429,15 @@ mod tests {
429429
// Apply the pointer to get at `b` and read it
430430
{
431431
let y = tuple_1.apply(&x);
432-
assert!(*y == 42.0);
432+
assert_eq!(*y, 42.0);
433433
}
434434

435435
// Apply the pointer to get at `b` and mutate it
436436
{
437437
let y = tuple_1.apply_mut(&mut x);
438438
*y = 5.0;
439439
}
440-
assert!(x.1 == 5.0);
440+
assert_eq!(x.1, 5.0);
441441
}
442442

443443
#[test]
@@ -460,7 +460,7 @@ mod tests {
460460
let y = bar_y_b.apply_mut(&mut x);
461461
*y = 42.0;
462462
}
463-
assert!(x.y.b == 42.0);
463+
assert_eq!(x.y.b, 42.0);
464464
}
465465

466466
struct Parameterized<T, U> {
@@ -508,7 +508,7 @@ mod tests {
508508
c: true,
509509
});
510510
let pb: Pin<&f64> = foo_b_pin.apply_pin(foo.as_ref());
511-
assert!(*pb == 22.0);
511+
assert_eq!(*pb, 22.0);
512512

513513
let mut x = Box::pin(Bar {
514514
x: 0,
@@ -523,6 +523,6 @@ mod tests {
523523

524524
let bar_y_pin = unsafe { offset_of!(Bar => y).as_pinned_projection() };
525525
*(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);
527527
}
528528
}

0 commit comments

Comments
 (0)