chore: clean Rust warnings and remove unused deps
Build Fechamento de Caixa / build (macos-14, app) (push) Has been cancelled
Build Fechamento de Caixa / build (ubuntu-22.04, deb) (push) Has been cancelled
Build Fechamento de Caixa / build (windows-2022, msi) (push) Has been cancelled

- Remove serde_yaml and tokio from Cargo.toml (unused)
- Add #[allow(dead_code)] to utility code kept for future use
  (CUT_FULL, ALIGN_RIGHT, line(), PrinterError, SupabaseError,
   atualizar_sync, remover, Lock variant)
- Zero compiler warnings on release build
This commit is contained in:
root
2026-06-24 14:51:56 +00:00
parent 5b1f3a2691
commit 5cab38a27c
6 changed files with 8 additions and 38 deletions
-35
View File
@@ -900,14 +900,12 @@ dependencies = [
"rusqlite", "rusqlite",
"serde", "serde",
"serde_json", "serde_json",
"serde_yaml",
"tauri", "tauri",
"tauri-build", "tauri-build",
"tauri-plugin-dialog", "tauri-plugin-dialog",
"tauri-plugin-fs", "tauri-plugin-fs",
"tauri-plugin-shell", "tauri-plugin-shell",
"thiserror 2.0.18", "thiserror 2.0.18",
"tokio",
"uuid", "uuid",
] ]
@@ -3281,19 +3279,6 @@ dependencies = [
"syn 2.0.118", "syn 2.0.118",
] ]
[[package]]
name = "serde_yaml"
version = "0.9.34+deprecated"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "6a8b1a1a2ebf674015cc02edccce75287f1a0130d394307b36743c2f5d504b47"
dependencies = [
"indexmap 2.14.0",
"itoa",
"ryu",
"serde",
"unsafe-libyaml",
]
[[package]] [[package]]
name = "serialize-to-javascript" name = "serialize-to-javascript"
version = "0.1.2" version = "0.1.2"
@@ -4070,25 +4055,11 @@ dependencies = [
"bytes", "bytes",
"libc", "libc",
"mio", "mio",
"parking_lot",
"pin-project-lite", "pin-project-lite",
"signal-hook-registry",
"socket2", "socket2",
"tokio-macros",
"windows-sys 0.61.2", "windows-sys 0.61.2",
] ]
[[package]]
name = "tokio-macros"
version = "2.7.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "385a6cb71ab9ab790c5fe8d67f1645e6c450a7ce006a33de03daa956cf70a496"
dependencies = [
"proc-macro2",
"quote",
"syn 2.0.118",
]
[[package]] [[package]]
name = "tokio-native-tls" name = "tokio-native-tls"
version = "0.3.1" version = "0.3.1"
@@ -4399,12 +4370,6 @@ version = "1.13.3"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c6f5d3c3b1bf09027a88a6bc961fc00497d651009560b5463668dc81b0fa87a8" checksum = "c6f5d3c3b1bf09027a88a6bc961fc00497d651009560b5463668dc81b0fa87a8"
[[package]]
name = "unsafe-libyaml"
version = "0.2.11"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "673aac59facbab8a9007c7f6108d11f63b603f7cabff99fabf650fea5c32b861"
[[package]] [[package]]
name = "untrusted" name = "untrusted"
version = "0.9.0" version = "0.9.0"
-2
View File
@@ -15,8 +15,6 @@ serde = { version = "1", features = ["derive"] }
serde_json = "1" serde_json = "1"
rusqlite = { version = "0.32", features = ["bundled"] } rusqlite = { version = "0.32", features = ["bundled"] }
reqwest = { version = "0.12", features = ["json", "blocking"] } reqwest = { version = "0.12", features = ["json", "blocking"] }
tokio = { version = "1", features = ["full"] }
serde_yaml = "0.9"
uuid = { version = "1", features = ["v4"] } uuid = { version = "1", features = ["v4"] }
chrono = { version = "0.4", features = ["serde"] } chrono = { version = "0.4", features = ["serde"] }
log = "0.4" log = "0.4"
+3
View File
@@ -8,6 +8,7 @@ pub const LF: &[u8] = b"\x0A";
/// Cortar papel (parcial) /// Cortar papel (parcial)
pub const CUT: &[u8] = b"\x1D\x56\x01"; pub const CUT: &[u8] = b"\x1D\x56\x01";
/// Cortar papel (total) /// Cortar papel (total)
#[allow(dead_code)]
pub const CUT_FULL: &[u8] = b"\x1D\x56\x00"; pub const CUT_FULL: &[u8] = b"\x1D\x56\x00";
/// Alimentar 3 linhas antes de cortar /// Alimentar 3 linhas antes de cortar
pub const FEED_CUT: &[u8] = b"\x1B\x64\x03"; pub const FEED_CUT: &[u8] = b"\x1B\x64\x03";
@@ -17,6 +18,7 @@ pub const BOLD_OFF: &[u8] = b"\x1B\x45\x00";
/// Alinhamento /// Alinhamento
pub const ALIGN_LEFT: &[u8] = b"\x1B\x61\x00"; pub const ALIGN_LEFT: &[u8] = b"\x1B\x61\x00";
pub const ALIGN_CENTER: &[u8] = b"\x1B\x61\x01"; pub const ALIGN_CENTER: &[u8] = b"\x1B\x61\x01";
#[allow(dead_code)]
pub const ALIGN_RIGHT: &[u8] = b"\x1B\x61\x02"; pub const ALIGN_RIGHT: &[u8] = b"\x1B\x61\x02";
/// Fonte normal / dupla /// Fonte normal / dupla
pub const FONT_NORMAL: &[u8] = b"\x1B\x21\x00"; pub const FONT_NORMAL: &[u8] = b"\x1B\x21\x00";
@@ -38,6 +40,7 @@ pub fn title(text: &str) -> Vec<u8> {
} }
/// Monta linha normal (alinhada à esquerda) /// Monta linha normal (alinhada à esquerda)
#[allow(dead_code)]
pub fn line(text: &str) -> Vec<u8> { pub fn line(text: &str) -> Vec<u8> {
let mut out = Vec::new(); let mut out = Vec::new();
out.extend_from_slice(ALIGN_LEFT); out.extend_from_slice(ALIGN_LEFT);
+1
View File
@@ -5,6 +5,7 @@ use std::sync::Mutex;
use thiserror::Error; use thiserror::Error;
#[derive(Error, Debug)] #[derive(Error, Debug)]
#[allow(dead_code)]
pub enum PrinterError { pub enum PrinterError {
#[error("Impressora não encontrada. Verifique se está conectada via USB e ligada.")] #[error("Impressora não encontrada. Verifique se está conectada via USB e ligada.")]
NotFound, NotFound,
+3 -1
View File
@@ -335,6 +335,7 @@ impl DbManager {
} }
/// Atualiza sync_status de um registro. /// Atualiza sync_status de um registro.
#[allow(dead_code)]
pub fn atualizar_sync(&self, uuid: &str, status: SyncStatus) -> Result<(), StorageError> { pub fn atualizar_sync(&self, uuid: &str, status: SyncStatus) -> Result<(), StorageError> {
let conn = self.conn.lock().map_err(|_| StorageError::Lock)?; let conn = self.conn.lock().map_err(|_| StorageError::Lock)?;
let now = Utc::now().format("%Y-%m-%dT%H:%M:%S%.3fZ").to_string(); let now = Utc::now().format("%Y-%m-%dT%H:%M:%S%.3fZ").to_string();
@@ -346,6 +347,7 @@ impl DbManager {
} }
/// Remove um registro (para debugging). /// Remove um registro (para debugging).
#[allow(dead_code)]
pub fn remover(&self, uuid: &str) -> Result<bool, StorageError> { pub fn remover(&self, uuid: &str) -> Result<bool, StorageError> {
let conn = self.conn.lock().map_err(|_| StorageError::Lock)?; let conn = self.conn.lock().map_err(|_| StorageError::Lock)?;
let n = conn.execute("DELETE FROM fechamentos WHERE uuid = ?1", params![uuid])?; let n = conn.execute("DELETE FROM fechamentos WHERE uuid = ?1", params![uuid])?;
@@ -508,7 +510,7 @@ pub fn carregar_rascunho(
// Simplifica para formato que o frontend espera // Simplifica para formato que o frontend espera
let total_sangrias: f64 = e.tabelas.sangrias.iter().filter_map(|r| r.valor).sum(); let total_sangrias: f64 = e.tabelas.sangrias.iter().filter_map(|r| r.valor).sum();
let total_despesas: f64 = e.tabelas.despesas.iter().filter_map(|r| r.valor).sum(); let total_despesas: f64 = e.tabelas.despesas.iter().filter_map(|r| r.valor).sum();
let total_receber: f64 = e.tabelas.areceber.iter().filter_map(|r| r.valor).sum(); let _total_receber: f64 = e.tabelas.areceber.iter().filter_map(|r| r.valor).sum();
let despesa_rows: Vec<_> = e.tabelas.despesas.iter().filter_map(|r| { let despesa_rows: Vec<_> = e.tabelas.despesas.iter().filter_map(|r| {
r.descricao.as_ref().map(|d| serde_json::json!({"desc": d, "valor": r.valor})) r.descricao.as_ref().map(|d| serde_json::json!({"desc": d, "valor": r.valor}))
}).collect(); }).collect();
+1
View File
@@ -8,6 +8,7 @@ use tauri::State;
use thiserror::Error; use thiserror::Error;
#[derive(Error, Debug)] #[derive(Error, Debug)]
#[allow(dead_code)]
pub enum SupabaseError { pub enum SupabaseError {
#[error("HTTP error: {0}")] #[error("HTTP error: {0}")]
Http(#[from] reqwest::Error), Http(#[from] reqwest::Error),