Add linter to CI (#823)

Co-authored-by: wiesche <wiesche89@googlemail.com>
This commit is contained in:
ardocrat
2026-10-07 20:48:38 +03:00
committed by GitHub
co-authored by wiesche
parent ec1e9910af
commit fe79256467
87 changed files with 1300 additions and 1639 deletions
+1 -1
View File
@@ -111,7 +111,7 @@ mod tests {
clean_output_dir(test_dir);
}
const SLATEPACK_DIR: &'static str = "target/test_output/slatepack";
const SLATEPACK_DIR: &str = "target/test_output/slatepack";
#[test]
fn pathbuf_get_file_contents() {
+4 -5
View File
@@ -27,7 +27,7 @@ use serde_json::{json, Value};
use std::collections::HashMap;
use std::convert::TryFrom;
use std::net::SocketAddr;
use std::path::PathBuf;
use std::path::{Path, PathBuf};
use std::sync::Arc;
#[derive(Clone)]
@@ -65,7 +65,7 @@ impl TorSlateSender {
}
/// Launch external Tor process.
fn launch_tor_process(config: &TorConfig, tor_dir: &PathBuf) -> Result<TorProcess, Error> {
fn launch_tor_process(config: &TorConfig, tor_dir: &Path) -> Result<TorProcess, Error> {
let mut tor = TorProcess::new();
let socks_proxy_addr = SocketAddr::V4(
config
@@ -101,7 +101,7 @@ impl TorSlateSender {
)
.map_err(|e| Error::TorConfig(format!("{:?}", e)))?;
// Start TOR process
let mut path = tor_dir.clone();
let mut path = tor_dir.to_path_buf();
path.push("torrc");
tor.torrc_path(path.to_str().unwrap())
.working_dir(tor_dir.to_str().unwrap())
@@ -184,8 +184,7 @@ impl TorSlateSender {
let client = Client::with_proxy(socks_proxy_addr, "socks5h://", timeout)
.map_err(|_| ClientError::Internal("Unable to create http client".into()))?;
let req = client.create_post_request(url, None, &input)?;
let res = client.send_request(req)?;
res
client.send_request(req)?
} else {
tor_post(&self.config, &input, url)
.map_err(|e| ClientError::RequestError(format!("{:?}", e)))?