From 6a777564a4319a3809a9e2872a3eaf1cc39b8b01 Mon Sep 17 00:00:00 2001 From: Cara Salter Date: Wed, 8 Jun 2022 14:14:24 -0400 Subject: meta: Complete project rename --- src/handlers/mod.rs | 2 +- src/handlers/planets.rs | 18 ++++++++++++++++++ src/handlers/waifus.rs | 18 ------------------ 3 files changed, 19 insertions(+), 19 deletions(-) create mode 100644 src/handlers/planets.rs delete mode 100644 src/handlers/waifus.rs (limited to 'src/handlers') diff --git a/src/handlers/mod.rs b/src/handlers/mod.rs index addf742..591f76e 100644 --- a/src/handlers/mod.rs +++ b/src/handlers/mod.rs @@ -1 +1 @@ -pub mod waifus; +pub mod planets; diff --git a/src/handlers/planets.rs b/src/handlers/planets.rs new file mode 100644 index 0000000..e80e7fe --- /dev/null +++ b/src/handlers/planets.rs @@ -0,0 +1,18 @@ +use axum::{response::IntoResponse, Json}; + +use tracing::{error, instrument}; + +use solarlib::star::Star; +use solarlib::planet::Planet; + +use crate::errors::*; + +pub async fn list() -> JsonResult>> { + let con_url = std::env::var("QEMU_URL").unwrap_or("qemu:///system".to_string()); + let mut star = Star::new(con_url)?; + + let inhabitants = star.inhabitants()?; + + Ok(Json(inhabitants)) +} + diff --git a/src/handlers/waifus.rs b/src/handlers/waifus.rs deleted file mode 100644 index 117ba15..0000000 --- a/src/handlers/waifus.rs +++ /dev/null @@ -1,18 +0,0 @@ -use axum::{response::IntoResponse, Json}; - -use tracing::{error, instrument}; - -use waifulib::house::House; -use waifulib::waifu::Waifu; - -use crate::errors::*; - -pub async fn list() -> JsonResult>> { - let con_url = std::env::var("QEMU_URL").unwrap_or("qemu:///system".to_string()); - let mut house: House = House::new(con_url)?; - - let inhabitants = house.inhabitants()?; - - Ok(Json(inhabitants)) -} - -- cgit v1.2.3