mirror of
https://github.com/bitwarden/browser
synced 2025-12-06 00:13:28 +00:00
[BEEEP] Add println clippy lints for desktop_native. (#16761)
* [BEEEP] Add println clippy lints for `desktop_native`. * remaining stray printlns
This commit is contained in:
1
apps/desktop/desktop_native/Cargo.lock
generated
1
apps/desktop/desktop_native/Cargo.lock
generated
@@ -2586,6 +2586,7 @@ dependencies = [
|
||||
"ctor 0.5.0",
|
||||
"desktop_core",
|
||||
"libc",
|
||||
"tracing",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
|
||||
@@ -79,6 +79,10 @@ zbus_polkit = "=5.0.0"
|
||||
zeroizing-alloc = "=0.1.0"
|
||||
|
||||
[workspace.lints.clippy]
|
||||
# Dis-allow println and eprintln, which are typically used in debugging.
|
||||
# Use `tracing` and `tracing-subscriber` crates for observability needs.
|
||||
print_stderr = "deny"
|
||||
print_stdout = "deny"
|
||||
string_slice = "warn"
|
||||
unused_async = "deny"
|
||||
unwrap_used = "deny"
|
||||
string_slice = "warn"
|
||||
|
||||
@@ -331,7 +331,6 @@ mod tests {
|
||||
fn get_alphabetic_hot_key_happy() {
|
||||
for c in ('a'..='z').chain('A'..='Z') {
|
||||
let letter = c.to_string();
|
||||
println!("{}", letter);
|
||||
let converted = get_alphabetic_hotkey(letter).unwrap();
|
||||
assert_eq!(converted, c as u16);
|
||||
}
|
||||
|
||||
@@ -12,3 +12,4 @@ crate-type = ["cdylib"]
|
||||
ctor = { workspace = true }
|
||||
desktop_core = { path = "../core" }
|
||||
libc = { workspace = true }
|
||||
tracing = { workspace = true }
|
||||
|
||||
@@ -7,6 +7,7 @@
|
||||
|
||||
use desktop_core::process_isolation;
|
||||
use std::{ffi::c_char, sync::LazyLock};
|
||||
use tracing::info;
|
||||
|
||||
static ORIGINAL_UNSETENV: LazyLock<unsafe extern "C" fn(*const c_char) -> i32> =
|
||||
LazyLock::new(|| unsafe {
|
||||
@@ -38,8 +39,8 @@ unsafe extern "C" fn unsetenv(name: *const c_char) -> i32 {
|
||||
#[ctor::ctor]
|
||||
fn preload_init() {
|
||||
let pid = unsafe { libc::getpid() };
|
||||
info!(pid, "Enabling memory security for process.");
|
||||
unsafe {
|
||||
println!("[Process Isolation] Enabling memory security for process {pid}");
|
||||
process_isolation::isolate_process();
|
||||
process_isolation::disable_coredumps();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user