tree-type 0.4.5

Rust macros for creating type-safe filesystem tree structures
Documentation
#[cfg(feature = "serde")]
mod serde_tests {
    use serde::Deserialize;
    use serde::Serialize;
    use tree_type::dir_type;
    use tree_type::file_type;

    // Test that file_type! generates serde derives when feature is enabled
    file_type!(TaskFile);

    // Test that dir_type! generates serde derives when feature is enabled
    dir_type!(CacheDir);

    #[derive(Serialize, Deserialize)]
    struct Container {
        task_file: TaskFile,
        cache_dir: CacheDir,
    }

    #[test]
    fn test_serde_serialization() {
        let task_file = TaskFile::new("/tmp/task.txt").unwrap();
        let cache_dir = CacheDir::new("/tmp/cache").unwrap();

        let container = Container {
            task_file,
            cache_dir,
        };

        // Test serialization
        let json = serde_json::to_string(&container).expect("Failed to serialize");
        assert!(json.contains("/tmp/task.txt"));
        assert!(json.contains("/tmp/cache"));

        // Test deserialization
        let _deserialized: Container = serde_json::from_str(&json).expect("Failed to deserialize");
    }
}