From 9831008b9ff42cf09e3ce80b091d0f701025a917 Mon Sep 17 00:00:00 2001 From: Franz Dietrich Date: Fri, 24 Oct 2025 17:35:23 +0200 Subject: [PATCH] fix clippy lints --- turtle-lib/src/execution.rs | 3 ++- turtle-lib/src/export.rs | 6 ++++++ turtle-lib/src/lib.rs | 5 +++++ 3 files changed, 13 insertions(+), 1 deletion(-) diff --git a/turtle-lib/src/execution.rs b/turtle-lib/src/execution.rs index 4049a71..29de0cb 100644 --- a/turtle-lib/src/execution.rs +++ b/turtle-lib/src/execution.rs @@ -199,6 +199,7 @@ pub fn record_fill_vertices_after_movement( /// Execute a single turtle command, updating state and adding draw commands #[tracing::instrument] +#[allow(clippy::too_many_lines)] pub fn execute_command(command: &TurtleCommand, state: &mut Turtle) { // Try to execute as side-effect-only command first if execute_command_side_effects(command, state) { @@ -277,7 +278,7 @@ pub fn execute_command(command: &TurtleCommand, state: &mut Turtle) { pen_width: state.params.pen_width, start_position: state.params.position, end_position: geom.position_at_angle(angle.to_radians()), - start_heading: start_heading, + start_heading, contours: None, }, }); diff --git a/turtle-lib/src/export.rs b/turtle-lib/src/export.rs index f4f5dad..0f2a79e 100644 --- a/turtle-lib/src/export.rs +++ b/turtle-lib/src/export.rs @@ -9,6 +9,7 @@ pub enum ExportError { // Weitere Formate können ergänzt werden } +#[derive(Clone, Copy, Debug)] pub enum DrawingFormat { #[cfg(feature = "svg")] Svg, @@ -16,5 +17,10 @@ pub enum DrawingFormat { } pub trait DrawingExporter { + /// Export the drawing to the specified format and filename + /// + /// # Errors + /// + /// Returns an error if the export fails (e.g., file I/O error) fn export(&self, world: &TurtleWorld, filename: &str) -> Result<(), ExportError>; } diff --git a/turtle-lib/src/lib.rs b/turtle-lib/src/lib.rs index afa1b92..fa8045d 100644 --- a/turtle-lib/src/lib.rs +++ b/turtle-lib/src/lib.rs @@ -97,6 +97,11 @@ pub struct TurtleApp { impl TurtleApp { /// Exportiere das aktuelle Drawing in das gewünschte Format #[allow(unused_variables)] + /// Export the current drawing to a file in the specified format + /// + /// # Errors + /// + /// Returns an error if the export fails (e.g., unsupported format, file I/O error) pub fn export_drawing( &self, filename: &str,