tree-type 0.4.5

Rust macros for creating type-safe filesystem tree structures
Documentation
#![allow(deprecated)]

// Test that macros work correctly even when users have custom Result type aliases
use tree_type::dir_type;
use tree_type::file_type;

// This is a common Rust pattern that would break the old macro implementation
#[allow(dead_code)]
type Result<T> = std::result::Result<T, CustomError>;

#[allow(dead_code)]
#[derive(Debug)]
struct CustomError;

dir_type!(TestDir);
file_type!(TestFile);

#[test]
fn test_macro_hygiene_with_custom_result() {
    // This test verifies that the macros use fully qualified std::io::Result
    // and don't conflict with the custom Result type alias above

    let dir = TestDir::new("/tmp/test_hygiene_dir").unwrap();
    let file = TestFile::new("/tmp/test_hygiene_file.txt").unwrap();

    // These should compile without errors because the macros use fully qualified types
    let _ = dir.create_all();
    let _: std::io::Result<String> = file.read_to_string();
}