diff --git a/src/lib.rs b/src/lib.rs index 23ed9656..fcaf8327 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -49,7 +49,7 @@ extern crate libpulse_sys; extern crate librespot_protocol as protocol; -// This doesn't play nice with syntex, so place it here +// include!/include_bytes! don't play nice with syntex, so place these here pub mod version { include!(concat!(env!("OUT_DIR"), "/version.rs")); @@ -58,6 +58,11 @@ pub mod version { } } +#[cfg(feature = "static-appkey")] +static APPKEY: Option<&'static [u8]> = Some(include_bytes!(concat!(env!("CARGO_MANIFEST_DIR"), "/spotify_appkey.key"))); +#[cfg(not(feature = "static-appkey"))] +static APPKEY: Option<&'static [u8]> = None; + #[cfg(feature = "with-syntex")] include!(concat!(env!("OUT_DIR"), "/lib.rs")); diff --git a/src/main_helper.rs b/src/main_helper.rs index e4b4a622..fe11e72b 100644 --- a/src/main_helper.rs +++ b/src/main_helper.rs @@ -12,11 +12,7 @@ use cache::{Cache, DefaultCache, NoCache}; use player::Player; use session::{Bitrate, Config, Session}; use version; - -#[cfg(feature = "static-appkey")] -static APPKEY: Option<&'static [u8]> = Some(include_bytes!(concat!(env!("CARGO_MANIFEST_DIR"), "/spotify_appkey.key"))); -#[cfg(not(feature = "static-appkey"))] -static APPKEY: Option<&'static [u8]> = None; +use APPKEY; pub fn find_backend(name: Option<&str>) -> &'static (Fn() -> Box + Send + Sync) { match name {