deepmerge 0.1.0

Deep merge functionality with policy-driven merging and derive macro support
Documentation
//! Example showing that Clone and PartialEq are NOT required by DeepMerge derive
//! 
//! Run with: cargo run --example no_clone_needed --features derive

use deepmerge::{DeepMerge, DefaultPolicy};

// This struct has NEITHER Clone nor PartialEq
#[derive(DeepMerge)]
struct UserProfile {
    username: String,
    email: String,
    age: u32,
    bio: String,
}

// Even complex nested structures don't need Clone/PartialEq
#[derive(DeepMerge)]
struct Application {
    profile: UserProfile,
    settings: AppSettings,
}

#[derive(DeepMerge)]
struct AppSettings {
    theme: String,
    notifications: bool,
    language: String,
}

fn main() {
    println!("=== DeepMerge without Clone or PartialEq ===\n");
    
    // Create initial config
    let mut app = Application {
        profile: UserProfile {
            username: "alice".to_string(),
            email: "alice@example.com".to_string(),
            age: 25,
            bio: "Software developer".to_string(),
        },
        settings: AppSettings {
            theme: "light".to_string(),
            notifications: true,
            language: "en".to_string(),
        },
    };
    
    // Create update
    let update = Application {
        profile: UserProfile {
            username: "alice_updated".to_string(),
            email: "alice@newdomain.com".to_string(),
            age: 26,
            bio: "Senior software developer".to_string(),
        },
        settings: AppSettings {
            theme: "dark".to_string(),
            notifications: false,
            language: "es".to_string(),
        },
    };
    
    println!("Before merge:");
    println!("  Username: {}", app.profile.username);
    println!("  Email: {}", app.profile.email);
    println!("  Theme: {}", app.settings.theme);
    println!();
    
    // Merge works fine without Clone or PartialEq!
    app.merge_with_policy(update, &DefaultPolicy);
    
    println!("After merge:");
    println!("  Username: {}", app.profile.username);
    println!("  Email: {}", app.profile.email);
    println!("  Theme: {}", app.settings.theme);
    println!();
    
    println!("✓ DeepMerge works without Clone or PartialEq!");
    println!();
    println!("Note: Clone is only needed if you want to use merge_ref()");
    println!("Note: PartialEq is only needed for assert_eq!() in tests");
}