fn draw_face<D>(target: &mut D, clock_face: &Circle) -> Result<(), D::Error>
where
    D: DrawTarget<Color = Rgb565>,
{
    // Draw the outer face.
    (*clock_face)
        .into_styled(PrimitiveStyle::with_stroke(Rgb565::WHITE, 2))
        .draw(target)?;

    // Draw 12 graduations.
    for angle in (0..12).map(hour_to_angle) {
        // Start point on circumference.
        let start = polar(clock_face, angle, 0);

        // End point offset by 10 pixels from the edge.
        let end = polar(clock_face, angle, -10);

        Line::new(start, end)
            .into_styled(PrimitiveStyle::with_stroke(Rgb565::WHITE, 1))
            .draw(target)?;
    }

    Ok(())
}
/// Draws a circle and 12 graduations as a simple clock face.
Draws a circle and 12 graduations as a simple clock face.
Draws a circle and 12 graduations as a simple clock face .
fn draw_face<D>(target: &mut D, clock_face: &Circle) -> Result<(), D::Error>
where
    D: DrawTarget<Color = Rgb565>,
{
    // Draw the outer face.
    (*clock_face)
        .into_styled(PrimitiveStyle::with_stroke(Rgb565::WHITE, 2))
        .draw(target)?;
    // Draw 12 graduations.
    for angle in (0..12).map(hour_to_angle) {
        // Start point on circumference.
        let start = polar(clock_face, angle, 0);
        // End point offset by 10 pixels from the edge.
        let end = polar(clock_face, angle, -10);
        Line::new(start, end)
            .into_styled(PrimitiveStyle::with_stroke(Rgb565::WHITE, 1))
            .draw(target)?;
    }
    Ok(())
}
fn draw_face < D > ( target : & mut D , clock_face : & Circle ) -> Result < ( ) , D :: Error > where D : DrawTarget < Color = Rgb565 > , { // Draw the outer face. ( * clock_face ) . into_styled ( PrimitiveStyle :: with_stroke ( Rgb565 :: WHITE , 2 ) ) . draw ( target ) ? ; // Draw 12 graduations. for angle in ( 0 .. 12 ) . map ( hour_to_angle ) { // Start point on circumference. let start = polar ( clock_face , angle , 0 ) ; // End point offset by 10 pixels from the edge. let end = polar ( clock_face , angle , - 10 ) ; Line :: new ( start , end ) . into_styled ( PrimitiveStyle :: with_stroke ( Rgb565 :: WHITE , 1 ) ) . draw ( target ) ? ; } Ok ( ( ) ) }
Draws a circle and 12 graduations as a simple clock face.
Draws a circle and 12 graduations as a simple clock face .
target
&mut D
clock_face
&Circle