experimenting with various ideas to avoid repeating code in config.rs

This commit is contained in:
2024-12-17 23:34:10 +01:00
parent d8f039d76b
commit 26733820f8
2 changed files with 16 additions and 1 deletions
+15
View File
@@ -10,6 +10,21 @@ use std::fs;
use std::io::{Error, Result};
use std::path::PathBuf;
// macro_rules! generate_field_names {
// ($(#[$attr:meta])* struct $name:ident { $($fname:ident : $ftype:ty),* }) => {
// $(#[$attr])* struct $name {
// $($fname : $ftype),*
// }
// impl $name {
// fn field_names() -> &'static [&'static str] {
// static NAMES: &'static [&'static str] = &[$(stringify!($fname)),*];
// NAMES
// }
// }
// }
// }
#[derive(Debug, Clone)]
pub struct Config {
conf_file: PathBuf,