diff --git a/src/api.rs b/src/api.rs
index c49e3cb..0ff1284 100644
--- a/src/api.rs
+++ b/src/api.rs
@@ -14,7 +14,7 @@ use xml::writer::{EmitterConfig, XmlEvent};
///
It's required to be set to something, which is why it's an Option set to None.
///
/// However, this is NOT optional, and attempting to do anything with CONFIG not set will return an `Err`.
-pub static mut CONFIG: Option = None;
+pub(crate) static mut CONFIG: Option = None;
/// Capabilities API endpoint (`/api?t=caps`)
// FIXME: VERY incomplete
@@ -22,14 +22,11 @@ pub static mut CONFIG: Option = None;
#[get("/api?t=caps")]
pub(crate) fn caps() -> status::Custom> {
unsafe {
- match CONFIG {
- None => {
- return status::Custom(
- Status::InternalServerError,
- RawXml("500 Internal server error: Config not specified".to_string()),
- );
- }
- Some(_) => {}
+ if CONFIG.is_none() {
+ return status::Custom(
+ Status::InternalServerError,
+ RawXml("500 Internal server error: Config not specified".to_string()),
+ );
}
}