Skip to content

Commit

Permalink
Add Debug and Clone to Drawing and others (#80)
Browse files Browse the repository at this point in the history
  • Loading branch information
MickHarrigan authored Nov 16, 2024
1 parent 1f72298 commit eaa9249
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 2 deletions.
1 change: 1 addition & 0 deletions build/header_generator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ use self::uuid::Uuid;
fn generate_struct(fun: &mut String, element: &Element) {
let mut seen_fields = HashSet::new();
fun.push_str("/// Contains common properties for the DXF file.\n");
fun.push_str("#[derive(Debug, Clone)]\n");
fun.push_str(
"#[cfg_attr(feature = \"serialize\", derive(serde::Serialize, serde::Deserialize))]\n",
);
Expand Down
2 changes: 1 addition & 1 deletion build/table_generator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ fn generate_table_items(fun: &mut String, element: &Element) {
for table in &element.children {
let mut seen_fields = HashSet::new();
let table_item = &table.children[0];
fun.push_str("#[derive(Debug)]\n");
fun.push_str("#[derive(Debug, Clone)]\n");
fun.push_str(
"#[cfg_attr(feature = \"serialize\", derive(serde::Serialize, serde::Deserialize))]\n",
);
Expand Down
2 changes: 1 addition & 1 deletion src/class.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ use crate::enums::*;
use crate::helper_functions::*;

/// Represents an application-defined class whose instances are `Block`s, `Entity`s, and `Object`s.
#[derive(Clone)]
#[derive(Debug, Clone)]
#[cfg_attr(feature = "serialize", derive(serde::Serialize, serde::Deserialize))]
pub struct Class {
/// Class DXF record name.
Expand Down
1 change: 1 addition & 0 deletions src/drawing.rs
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ use std::path::Path;
pub(crate) const AUTO_REPLACE_HANDLE: Handle = Handle(0xFFFF_FFFF_FFFF_FFFF);

/// Represents a DXF drawing.
#[derive(Debug, Clone)]
#[cfg_attr(feature = "serialize", derive(serde::Serialize, serde::Deserialize))]
pub struct Drawing {
/// The drawing's header. Contains various drawing-specific values and settings.
Expand Down

0 comments on commit eaa9249

Please sign in to comment.