proxmox: add sortable-macro feature

Use:
    # Cargo.toml:
    [dependencies]
    proxmox = { version = "0.1", features = [ "sortable-macro" ] }

    # file.rs
    use proxmox::{sortable, identity};
    #[sortable]
    const DATA: &[u8; 4] = sorted!([3, 4, 1, 2]);

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
This commit is contained in:
Wolfgang Bumiller 2019-11-21 11:02:48 +01:00
parent ceb3ff5544
commit 297aca53f7
2 changed files with 7 additions and 0 deletions

View File

@ -12,8 +12,10 @@ proxmox-api = { path = "../proxmox-api" }
proxmox-api-macro = { path = "../proxmox-api-macro", optional = true } proxmox-api-macro = { path = "../proxmox-api-macro", optional = true }
proxmox-sys = { path = "../proxmox-sys" } proxmox-sys = { path = "../proxmox-sys" }
proxmox-tools = { path = "../proxmox-tools" } proxmox-tools = { path = "../proxmox-tools" }
sorted-data = { path = "../sorted-data", optional = true }
[features] [features]
default = [] default = []
valgrind = ["proxmox-tools/valgrind"] valgrind = ["proxmox-tools/valgrind"]
api-macro = ["proxmox-api-macro"] api-macro = ["proxmox-api-macro"]
sortable-macro = ["sorted-data"]

View File

@ -8,3 +8,8 @@ pub mod api {
#[cfg(feature = "api-macro")] #[cfg(feature = "api-macro")]
pub use proxmox_api_macro::{api, router}; pub use proxmox_api_macro::{api, router};
} }
#[cfg(feature = "sortable-macro")]
pub use proxmox_tools::identity;
#[cfg(feature = "sortable-macro")]
pub use sorted_data::{self, sortable};