html terminal
| -rw-r--r-- | src/bot/schematic.rs | 25 | ||||
| -rw-r--r-- | src/conv.rs | 8 |
2 files changed, 0 insertions, 33 deletions
diff --git a/src/bot/schematic.rs b/src/bot/schematic.rs index e37149d..1c833ac 100644 --- a/src/bot/schematic.rs +++ b/src/bot/schematic.rs @@ -1,5 +1,4 @@ use anyhow::{anyhow, Result}; -use mindus::block::ratios::Resource; use mindus::data::DataRead; use mindus::*; use oxipng::*; @@ -43,7 +42,6 @@ pub async fn with(m: SMsg, c: &serenity::client::Context) -> Result<ControlFlow< let d = v.tags.get("description").map(|t| crate::conv::replace(t)); let name = crate::conv::replace(&strip_colors(v.tags.get("name").unwrap())); let cost = v.compute_total_cost().0; - let rats = v.ratios(); let p = tokio::task::spawn_blocking(move || to_png(&v)).await?; anyhow::Ok( m.channel @@ -63,29 +61,6 @@ pub async fn with(m: SMsg, c: &serenity::client::Context) -> Result<ControlFlow< write!(s, "{} {n} ", crate::conv::item(i)).unwrap(); } e.field("req", s, true); - macro_rules! fmt { - ($i:ident) => {{ - let mut s = String::new(); - for &(i, n) in &*rats.$i { - let e = crate::conv::res(i); - if matches!(i, Resource::Item(_)) && n % 10.5 < 0.1 { - match (n / 10.5).round() as u64 { - 1 => write!(s, "{e} <:titanium_conveyor:1165056617809715210> ").unwrap(), - n => write!(s, "{e} {n} <:titanium_conveyor:1165056617809715210>'s ").unwrap() - } - } else { - write!(s, "{e} {n}/s ").unwrap(); - } - } - s - }} - } - if !rats.input.is_empty() { - e.field("in", fmt!(input), true); - } - if !rats.output.is_empty() { - e.field("out", fmt!(output), true); - } e.title(name) .footer(|f| f.text(format!("requested by {author}"))) .color(SUCCESS) diff --git a/src/conv.rs b/src/conv.rs index d8465ea..c5902f1 100644 --- a/src/conv.rs +++ b/src/conv.rs @@ -1,4 +1,3 @@ -use mindus::block::ratios::Resource; use mindus::fluid::Type as Fluid; use mindus::item::Type as Item; @@ -219,13 +218,6 @@ static E2E: phf::Map<char, &str> = phf::phf_map! { '' => fluid(Fluid::Cyanogen), }; -pub const fn res(r: Resource) -> &'static str { - match r { - Resource::Item(i) => item(i), - Resource::Fluid(f) => fluid(f), - } -} - pub const fn fluid(f: Fluid) -> &'static str { use Fluid::*; match f { |