add derive Register macro
This commit is contained in:
+5
-15
@@ -9,28 +9,18 @@ use std::process::Command;
|
||||
|
||||
use anyhow::{Context, Result};
|
||||
|
||||
use crate::register_backends;
|
||||
use crate::{Group, Package};
|
||||
use pacdef_macro::Register;
|
||||
|
||||
pub(crate) use todo_per_backend::ToDoPerBackend;
|
||||
|
||||
pub(in crate::backend) type Switches = &'static [&'static str];
|
||||
pub(in crate::backend) type Text = &'static str;
|
||||
|
||||
register_backends!(Pacman, Rust);
|
||||
|
||||
// TODO find a way to include this in the `register_backends!` macro
|
||||
pub(crate) use pacman::Pacman;
|
||||
pub(crate) use rust::Rust;
|
||||
|
||||
// TODO find a way to include this in the `register_backends!` macro
|
||||
impl Backends {
|
||||
fn next(&self) -> Option<Self> {
|
||||
match self {
|
||||
Self::Pacman => Some(Self::Rust),
|
||||
Self::Rust => None,
|
||||
}
|
||||
}
|
||||
#[derive(Debug, Register)]
|
||||
pub(crate) enum Backends {
|
||||
Pacman,
|
||||
Rust,
|
||||
}
|
||||
|
||||
#[derive(Debug)]
|
||||
|
||||
Reference in New Issue
Block a user