mirror of
https://github.com/bitwarden/browser
synced 2026-02-14 23:45:37 +00:00
Fix formatting
This commit is contained in:
@@ -1,7 +1,4 @@
|
||||
use std::{
|
||||
error::Error,
|
||||
path::PathBuf,
|
||||
};
|
||||
use std::{error::Error, path::PathBuf};
|
||||
|
||||
use futures::{SinkExt, StreamExt, TryFutureExt};
|
||||
|
||||
@@ -84,9 +81,9 @@ impl Server {
|
||||
// Create the server and start listening for incoming connections
|
||||
// in a separate task to avoid blocking the current task
|
||||
let server = Server {
|
||||
paths,
|
||||
paths,
|
||||
cancel_token: cancel_token.clone(),
|
||||
server_to_clients_send
|
||||
server_to_clients_send,
|
||||
};
|
||||
Ok(server)
|
||||
}
|
||||
|
||||
@@ -438,11 +438,12 @@ pub mod ipc {
|
||||
|
||||
let path = desktop_core::ipc::all_paths(&name);
|
||||
|
||||
let server = desktop_core::ipc::server::Server::start(path.clone(), send).map_err(|e| {
|
||||
napi::Error::from_reason(format!(
|
||||
"Error listening to server - Path: {path:?} - Error: {e} - {e:?}"
|
||||
))
|
||||
})?;
|
||||
let server =
|
||||
desktop_core::ipc::server::Server::start(path.clone(), send).map_err(|e| {
|
||||
napi::Error::from_reason(format!(
|
||||
"Error listening to server - Path: {path:?} - Error: {e} - {e:?}"
|
||||
))
|
||||
})?;
|
||||
|
||||
Ok(IpcServer { server })
|
||||
}
|
||||
@@ -452,7 +453,8 @@ pub mod ipc {
|
||||
pub fn get_paths(&self) -> Vec<String> {
|
||||
self.server
|
||||
.paths
|
||||
.iter().map(|p| p.to_string_lossy().to_string())
|
||||
.iter()
|
||||
.map(|p| p.to_string_lossy().to_string())
|
||||
.collect()
|
||||
}
|
||||
|
||||
@@ -705,11 +707,12 @@ pub mod autofill {
|
||||
|
||||
let path = desktop_core::ipc::path(&name);
|
||||
|
||||
let server = desktop_core::ipc::server::Server::start(vec![path.clone()], send).map_err(|e| {
|
||||
napi::Error::from_reason(format!(
|
||||
"Error listening to server - Path: {path:?} - Error: {e} - {e:?}"
|
||||
))
|
||||
})?;
|
||||
let server = desktop_core::ipc::server::Server::start(vec![path.clone()], send)
|
||||
.map_err(|e| {
|
||||
napi::Error::from_reason(format!(
|
||||
"Error listening to server - Path: {path:?} - Error: {e} - {e:?}"
|
||||
))
|
||||
})?;
|
||||
|
||||
Ok(IpcServer { server })
|
||||
}
|
||||
|
||||
@@ -56,10 +56,15 @@ async fn main() {
|
||||
let should_foreground = windows::allow_foreground();
|
||||
|
||||
let sock_paths = desktop_core::ipc::all_paths("bitwarden");
|
||||
let sock_path = *sock_paths.iter().filter(|p| p.exists()).collect::<Vec<_>>().first().unwrap_or_else(|| {
|
||||
error!("No valid socket path found.");
|
||||
std::process::exit(1);
|
||||
});
|
||||
let sock_path = *sock_paths
|
||||
.iter()
|
||||
.filter(|p| p.exists())
|
||||
.collect::<Vec<_>>()
|
||||
.first()
|
||||
.unwrap_or_else(|| {
|
||||
error!("No valid socket path found.");
|
||||
std::process::exit(1);
|
||||
});
|
||||
|
||||
let log_path = {
|
||||
let mut path = sock_path.clone();
|
||||
|
||||
Reference in New Issue
Block a user