html terminal
update mindus
bendn 2023-08-13
parent eecda97 · commit d6a77ac
-rw-r--r--Cargo.toml2
-rw-r--r--src/bot/maps.rs4
-rw-r--r--src/bot/schematic.rs4
-rw-r--r--src/main.rs1
4 files changed, 5 insertions, 6 deletions
diff --git a/Cargo.toml b/Cargo.toml
index 9133e94..ad7a705 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -39,7 +39,7 @@ parse_duration = "2.1.1"
serde = "1.0"
serde_json = "1.0"
btparse = "0.1.1"
-mindus = { version = "3", features = [], default-features = false }
+mindus = { version = "4", features = [], default-features = false }
image = { version = "0.24.6", features = ["png"], default-features = false }
oxipng = { git = "https://github.com/shssoichiro/oxipng", branch = "master", features = [], default-features = false }
strip-ansi-escapes = "0.2.0"
diff --git a/src/bot/maps.rs b/src/bot/maps.rs
index 015c276..a50d527 100644
--- a/src/bot/maps.rs
+++ b/src/bot/maps.rs
@@ -106,7 +106,7 @@ impl MapImage {
let deser_took = then.elapsed();
let name = m.tags.get("mapname").unwrap().to_owned();
let render_took = Instant::now();
- let i = unsafe { m.render() };
+ let i = m.render();
let render_took = render_took.elapsed();
let compression_took = Instant::now();
let i = RawImage::new(
@@ -116,7 +116,7 @@ impl MapImage {
transparent_color: None,
},
BitDepth::Eight,
- i.into_vec(),
+ i.buffer,
)
.unwrap();
*lock = i
diff --git a/src/bot/schematic.rs b/src/bot/schematic.rs
index 2499ca9..16d1b07 100644
--- a/src/bot/schematic.rs
+++ b/src/bot/schematic.rs
@@ -45,7 +45,7 @@ pub async fn draw(ctx: Context<'_>, schematic: String) -> Result<()> {
async fn send(ctx: &Context<'_>, s: &Schematic<'_>, send_schematic: bool) -> Result<()> {
let n = strip_colors(s.tags.get("name").unwrap());
- let p = unsafe { s.render() };
+ let p = s.render();
let p = RawImage::new(
p.width(),
p.height(),
@@ -53,7 +53,7 @@ async fn send(ctx: &Context<'_>, s: &Schematic<'_>, send_schematic: bool) -> Res
transparent_color: None,
},
BitDepth::Eight,
- p.into_vec(),
+ p.buffer,
)
.unwrap();
let p = p
diff --git a/src/main.rs b/src/main.rs
index 95ec46a..34ee551 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -13,7 +13,6 @@ use std::net::SocketAddr;
#[tokio::main(flavor = "current_thread")]
async fn main() {
- unsafe { mindus::warmup() };
Server::spawn(SocketAddr::from((
[0, 0, 0, 0],
std::env::var("PORT").map_or(4001, |x| u16::from_str(&x).unwrap()),