fix clippy lints

This commit is contained in:
Franz Dietrich 2025-10-24 17:35:23 +02:00
parent a3cad7d1bc
commit 9831008b9f
3 changed files with 13 additions and 1 deletions

View File

@ -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,
},
});

View File

@ -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>;
}

View File

@ -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,