From e1aa49910b313ef341b22526b2d1124d55257b85 Mon Sep 17 00:00:00 2001 From: GeekMasher Date: Wed, 7 Aug 2024 01:55:51 +0100 Subject: [PATCH] fix: Update features cfg for octocrab --- Cargo.toml | 2 +- src/error.rs | 1 + src/lib.rs | 6 ++++++ 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/Cargo.toml b/Cargo.toml index 6498496..2f4217f 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -19,7 +19,7 @@ default = ["octocrab"] octocrab = ["dep:octocrab"] # Web frameworks -rocket = ["dep:rocket"] +rocket = ["dep:rocket", "octocrab"] [dependencies] thiserror = "1" diff --git a/src/error.rs b/src/error.rs index 7da2737..6450399 100644 --- a/src/error.rs +++ b/src/error.rs @@ -19,6 +19,7 @@ pub enum OctoAppError { IoError(#[from] std::io::Error), /// Octocrab Error + #[cfg(feature = "octocrab")] #[error("Octocrab Error: {0}")] OctocrabError(#[from] octocrab::Error), diff --git a/src/lib.rs b/src/lib.rs index b54a9d1..eb8e88b 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -2,10 +2,13 @@ #![forbid(unsafe_code)] #![deny(missing_docs)] #![doc = include_str!("../README.md")] + +#[cfg(feature = "octocrab")] extern crate octocrab; pub mod config; pub mod error; +#[cfg(feature = "octocrab")] pub mod events; #[cfg(feature = "rocket")] @@ -13,6 +16,7 @@ pub mod ghrocket; pub use config::OctoAppConfig; pub use error::OctoAppError; +#[cfg(feature = "octocrab")] pub use events::WebHook; #[cfg(feature = "rocket")] @@ -22,9 +26,11 @@ pub use ghrocket::OctoAppState; pub mod prelude { pub use crate::config::OctoAppConfig; pub use crate::error::OctoAppError; + #[cfg(feature = "octocrab")] pub use crate::events::{Event, WebHook}; // Re-export payloads + #[cfg(feature = "octocrab")] pub use crate::events::payloads::*; #[cfg(feature = "rocket")]