Skip to content

Commit 2895a0c

Browse files
committed
feat: swap base64 crate for data-encoding
1 parent 68b57c9 commit 2895a0c

File tree

3 files changed

+11
-10
lines changed

3 files changed

+11
-10
lines changed

Cargo.lock

+7-7
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ description = "leafcast pi client"
88
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
99

1010
[dependencies]
11-
base64 = "0.21"
1211
clap={version="4.4", features = ["derive", "unicode"] }
12+
data-encoding = "2.4.0"
1313
dotenvy = "0.15"
1414
figlet-rs = "0.1"
1515
futures-util = "0.3"

src/ws/ws_sender.rs

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
use base64::{engine, Engine};
1+
use data_encoding::BASE64;
22
use futures_util::lock::Mutex;
33
use futures_util::SinkExt;
44
use std::process;
@@ -81,10 +81,11 @@ impl WSSender {
8181
date_time.second()
8282
);
8383
let pi_info = SysInfo::new(&self.app_envs, connected_at).await;
84+
8485
Response::Photo(Photo {
8586
image: format!(
8687
"data:image/webp;base64,{}",
87-
engine::general_purpose::STANDARD.encode(photo_buffer)
88+
BASE64.encode(photo_buffer.as_slice())
8889
),
8990
pi_info,
9091
timestamp,

0 commit comments

Comments
 (0)