Skip to content

Commit 7b2a969

Browse files
committed
Fix a few minor warnings and compiler nits
1 parent 365fb00 commit 7b2a969

File tree

5 files changed

+23
-6
lines changed

5 files changed

+23
-6
lines changed

Cargo.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,9 @@ ctrlc = "3.4.6"
8484
affinity = "0.1.2"
8585
jemallocator = "0.5.4"
8686

87+
[dev-dependencies]
88+
serde_yaml = "0.9.34"
89+
8790
# Optimize the heck out of the release build, I have no idea what these flags
8891
# do
8992
[profile.release]

src/serve/tls.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ fn load_tls_config(state: &ServerState) -> std::io::Result<ServerConfig> {
7979
panic!("TLS key could not be properly loaded! This is fatal!");
8080
}
8181

82-
if let Some(ca_path) = ca.as_ref() {
82+
if let Some(_ca_path) = ca.as_ref() {
8383
panic!("Using a custom Certificate Authority is not currently supported!");
8484
} else {
8585
debug!("Loading the certificate and key into the ServerConfig: {cert:?}");

src/sink/kafka.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ use serde::Deserialize;
1515
use tracing::log::*;
1616

1717
use std::collections::HashMap;
18-
use std::time::{Duration, Instant};
18+
use std::time::Duration;
1919

2020
use super::{Message, Sink};
2121
use crate::status::Stats;

src/sink/parquet.rs

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,9 +47,8 @@ impl Sink for Parquet {
4747
let (tx, rx) = bounded(1024);
4848
// [object_store] largely expects environment variables to be all lowercased for
4949
// consideration as options
50-
let opts: HashMap<String, String> = HashMap::from_iter(
51-
std::env::vars().map(|(k, v)| (k.to_ascii_lowercase(), v))
52-
);
50+
let opts: HashMap<String, String> =
51+
HashMap::from_iter(std::env::vars().map(|(k, v)| (k.to_ascii_lowercase(), v)));
5352
let (store, _path) = object_store::parse_url_opts(&config.url, opts)
5453
.expect("Failed to parse the Parquet sink URL");
5554
let store = Arc::new(store);
@@ -219,6 +218,21 @@ fn parquet_flush_default() -> usize {
219218
mod tests {
220219
use super::*;
221220

221+
#[test]
222+
fn test_deser_config() {
223+
let conf = r#"
224+
---
225+
url: 's3://bucket'
226+
"#;
227+
let parquet: Config = serde_yaml::from_str(conf).expect("Failed to deserialize");
228+
assert_eq!(parquet.buffer, parquet_buffer_default());
229+
assert_eq!(parquet.flush_ms, parquet_flush_default());
230+
assert_eq!(
231+
parquet.url,
232+
Url::parse("s3://bucket").expect("Failed to parse a basic URL")
233+
);
234+
}
235+
222236
#[test]
223237
fn test_defaults() {
224238
assert!(0 < parquet_buffer_default());

src/status.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ pub async fn status_server(listen_to: String) -> Result<(), std::io::Error> {
2727
app.at("/")
2828
.get(|_| async move { Ok("hotdog status server") });
2929

30-
app.at("/stats").get(|req: Request<()>| async move {
30+
app.at("/stats").get(|_req: Request<()>| async move {
3131
let health: HashMap<String, String> = HashMap::default();
3232

3333
let mut res = Response::new(StatusCode::Ok);

0 commit comments

Comments
 (0)