fix clippy lints
This commit is contained in:
parent
a3cad7d1bc
commit
9831008b9f
@ -199,6 +199,7 @@ pub fn record_fill_vertices_after_movement(
|
|||||||
|
|
||||||
/// Execute a single turtle command, updating state and adding draw commands
|
/// Execute a single turtle command, updating state and adding draw commands
|
||||||
#[tracing::instrument]
|
#[tracing::instrument]
|
||||||
|
#[allow(clippy::too_many_lines)]
|
||||||
pub fn execute_command(command: &TurtleCommand, state: &mut Turtle) {
|
pub fn execute_command(command: &TurtleCommand, state: &mut Turtle) {
|
||||||
// Try to execute as side-effect-only command first
|
// Try to execute as side-effect-only command first
|
||||||
if execute_command_side_effects(command, state) {
|
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,
|
pen_width: state.params.pen_width,
|
||||||
start_position: state.params.position,
|
start_position: state.params.position,
|
||||||
end_position: geom.position_at_angle(angle.to_radians()),
|
end_position: geom.position_at_angle(angle.to_radians()),
|
||||||
start_heading: start_heading,
|
start_heading,
|
||||||
contours: None,
|
contours: None,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|||||||
@ -9,6 +9,7 @@ pub enum ExportError {
|
|||||||
// Weitere Formate können ergänzt werden
|
// Weitere Formate können ergänzt werden
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[derive(Clone, Copy, Debug)]
|
||||||
pub enum DrawingFormat {
|
pub enum DrawingFormat {
|
||||||
#[cfg(feature = "svg")]
|
#[cfg(feature = "svg")]
|
||||||
Svg,
|
Svg,
|
||||||
@ -16,5 +17,10 @@ pub enum DrawingFormat {
|
|||||||
}
|
}
|
||||||
|
|
||||||
pub trait DrawingExporter {
|
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>;
|
fn export(&self, world: &TurtleWorld, filename: &str) -> Result<(), ExportError>;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -97,6 +97,11 @@ pub struct TurtleApp {
|
|||||||
impl TurtleApp {
|
impl TurtleApp {
|
||||||
/// Exportiere das aktuelle Drawing in das gewünschte Format
|
/// Exportiere das aktuelle Drawing in das gewünschte Format
|
||||||
#[allow(unused_variables)]
|
#[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(
|
pub fn export_drawing(
|
||||||
&self,
|
&self,
|
||||||
filename: &str,
|
filename: &str,
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user