Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Debug and Clone to Drawing and others #80

Merged
merged 1 commit into from
Nov 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading