refact(backend): make macro crate-public

This commit is contained in:
steven-omaha
2023-05-22 12:33:25 +02:00
parent 32c2471073
commit b6c2ccaf48
6 changed files with 12 additions and 6 deletions
@@ -6,7 +6,8 @@ use alpm::PackageReason::Explicit;
use anyhow::{Context, Result}; use anyhow::{Context, Result};
use crate::backend::backend_trait::{Backend, Switches, Text}; use crate::backend::backend_trait::{Backend, Switches, Text};
use crate::{impl_backend_constants, Group, Package}; use crate::backend::macros::impl_backend_constants;
use crate::{Group, Package};
#[derive(Debug, Clone)] #[derive(Debug, Clone)]
pub struct Arch { pub struct Arch {
@@ -7,7 +7,8 @@ use rust_apt::cache::PackageSort;
use rust_apt::new_cache; use rust_apt::new_cache;
use crate::backend::backend_trait::{Backend, Switches, Text}; use crate::backend::backend_trait::{Backend, Switches, Text};
use crate::{impl_backend_constants, Group, Package}; use crate::backend::macros::impl_backend_constants;
use crate::{Group, Package};
#[derive(Debug, Clone)] #[derive(Debug, Clone)]
pub struct Debian { pub struct Debian {
@@ -5,7 +5,8 @@ use std::process::ExitStatus;
use anyhow::{Context, Result}; use anyhow::{Context, Result};
use crate::backend::backend_trait::{Backend, Switches, Text}; use crate::backend::backend_trait::{Backend, Switches, Text};
use crate::{impl_backend_constants, Group, Package}; use crate::backend::macros::impl_backend_constants;
use crate::{Group, Package};
#[derive(Debug, Clone)] #[derive(Debug, Clone)]
pub struct Flatpak { pub struct Flatpak {
@@ -7,7 +7,8 @@ use anyhow::Result;
use serde_json::Value; use serde_json::Value;
use crate::backend::backend_trait::{Backend, Switches, Text}; use crate::backend::backend_trait::{Backend, Switches, Text};
use crate::{impl_backend_constants, Group, Package}; use crate::backend::macros::impl_backend_constants;
use crate::{Group, Package};
#[derive(Debug, Clone)] #[derive(Debug, Clone)]
pub struct Python { pub struct Python {
@@ -7,7 +7,8 @@ use anyhow::{Context, Result};
use serde_json::Value; use serde_json::Value;
use crate::backend::backend_trait::{Backend, Switches, Text}; use crate::backend::backend_trait::{Backend, Switches, Text};
use crate::{impl_backend_constants, Group, Package}; use crate::backend::macros::impl_backend_constants;
use crate::{Group, Package};
#[derive(Debug, Clone)] #[derive(Debug, Clone)]
pub struct Rust { pub struct Rust {
+2 -1
View File
@@ -1,6 +1,5 @@
/// Used to implement parts of the `Backend` trait that should not change between the actual /// Used to implement parts of the `Backend` trait that should not change between the actual
/// backends (boilerplate). /// backends (boilerplate).
#[macro_export]
macro_rules! impl_backend_constants { macro_rules! impl_backend_constants {
() => { () => {
fn get_binary_default(&self) -> Text { fn get_binary_default(&self) -> Text {
@@ -57,3 +56,5 @@ macro_rules! impl_backend_constants {
} }
}; };
} }
pub(crate) use impl_backend_constants;