File tree 2 files changed +4
-12
lines changed
2 files changed +4
-12
lines changed Original file line number Diff line number Diff line change @@ -394,9 +394,7 @@ impl f32 {
394
394
/// Converts radians to degrees.
395
395
///
396
396
/// ```
397
- /// use std::f32::consts;
398
- ///
399
- /// let angle = consts::PI;
397
+ /// let angle = std::f32::consts::PI;
400
398
///
401
399
/// let abs_difference = (angle.to_degrees() - 180.0).abs();
402
400
///
@@ -413,11 +411,9 @@ impl f32 {
413
411
/// Converts degrees to radians.
414
412
///
415
413
/// ```
416
- /// use std::f32::consts;
417
- ///
418
414
/// let angle = 180.0f32;
419
415
///
420
- /// let abs_difference = (angle.to_radians() - consts::PI).abs();
416
+ /// let abs_difference = (angle.to_radians() - std::f32:: consts::PI).abs();
421
417
///
422
418
/// assert!(abs_difference <= f32::EPSILON);
423
419
/// ```
Original file line number Diff line number Diff line change @@ -407,9 +407,7 @@ impl f64 {
407
407
/// Converts radians to degrees.
408
408
///
409
409
/// ```
410
- /// use std::f64::consts;
411
- ///
412
- /// let angle = consts::PI;
410
+ /// let angle = std::f64::consts::PI;
413
411
///
414
412
/// let abs_difference = (angle.to_degrees() - 180.0).abs();
415
413
///
@@ -427,11 +425,9 @@ impl f64 {
427
425
/// Converts degrees to radians.
428
426
///
429
427
/// ```
430
- /// use std::f64::consts;
431
- ///
432
428
/// let angle = 180.0_f64;
433
429
///
434
- /// let abs_difference = (angle.to_radians() - consts::PI).abs();
430
+ /// let abs_difference = (angle.to_radians() - std::f64:: consts::PI).abs();
435
431
///
436
432
/// assert!(abs_difference < 1e-10);
437
433
/// ```
You can’t perform that action at this time.
0 commit comments