implement generic backend methods with a macro

This commit is contained in:
steven-omaha
2023-01-09 17:23:34 +01:00
parent d8027c23db
commit 0da136fef7
4 changed files with 25 additions and 32 deletions
+20
View File
@@ -0,0 +1,20 @@
#[macro_export]
macro_rules! impl_backend_constants {
($name:ident) => {
fn get_binary(&self) -> Text {
BINARY
}
fn get_section(&self) -> Text {
SECTION
}
fn get_switches_install(&self) -> Switches {
SWITCHES_INSTALL
}
fn get_switches_remove(&self) -> Switches {
SWITCHES_REMOVE
}
};
}