Skip to content

Commit

Permalink
Fix warnings from stable clippy
Browse files Browse the repository at this point in the history
  • Loading branch information
arnodb committed Nov 9, 2024
1 parent cf43a08 commit 8e8dfa4
Show file tree
Hide file tree
Showing 9 changed files with 11 additions and 37 deletions.
2 changes: 1 addition & 1 deletion codegen/quirky_binder_codegen/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ impl ModuleCode {
_ => self
.sub_modules
.entry(path[path_index].clone())
.or_insert_with(ModuleCode::default)
.or_default()
.add(path, path_index + 1, code),
}
}
Expand Down
6 changes: 3 additions & 3 deletions quirky_binder/src/filter/monitor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ pub monitor()
use chrono::{DateTime, Utc};
let mut csv = File::create("qb_monitor.csv").unwrap();
write!(csv, "Timestamp,memory_rss,memory_swap,memory_object,memory_wrapped\n").unwrap();
writeln!(csv, "Timestamp,memory_rss,memory_swap,memory_object,memory_wrapped").unwrap();
let mut meter = self_meter::Meter::new(Duration::from_millis(1000)).unwrap();
meter.track_current_thread("main");
Expand All @@ -40,9 +40,9 @@ pub monitor()
if let Some(report) = report.as_ref() {
let timestamp = DateTime::<Utc>::from(report.timestamp);
let data = crate::quirky_binder_monitor::DATA.lock().unwrap();
write!(
writeln!(
csv,
"{},{},{},{},{}\n",
"{},{},{},{},{}",
timestamp,
report.memory_rss,
report.memory_swap,
Expand Down
2 changes: 1 addition & 1 deletion quirky_binder/src/graph/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ impl Graph {
use std::io::Write;

{
let mut file = File::create(&output.join("streams.rs")).unwrap();
let mut file = File::create(output.join("streams.rs")).unwrap();
let mut scope = Scope::new();
for (record_type, definition) in &self.record_definitions {
let module = scope.get_or_new_module(&record_type[0]).vis("pub");
Expand Down
2 changes: 1 addition & 1 deletion quirky_binder_lang/src/parser/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ impl SpannedErrorKind {
}
}

trait ToSpannedError<'a> {
pub trait ToSpannedError<'a> {
fn to_spanned_error(&self, input: &'a str) -> SpannedError<&'a str>;
}

Expand Down
2 changes: 1 addition & 1 deletion quirky_binder_support/src/iterator/accumulate.rs
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ mod tests {
fn should_accumulate_stream() {
#[derive(Debug)]
enum Error {
Bincode(bincode::Error),
Bincode(#[allow(dead_code)] bincode::Error),
}

impl From<bincode::Error> for Error {
Expand Down
26 changes: 2 additions & 24 deletions quirky_binder_support/src/iterator/sort.rs
Original file line number Diff line number Diff line change
Expand Up @@ -239,28 +239,6 @@ where
}
}

trait Heads<Record>: Send {
fn push(&mut self, record: Record);

fn pop(&mut self) -> Option<Record>;

fn is_empty(&self) -> bool;
}

impl<Record: Send, C: Compare<Record> + Send> Heads<Record> for BinaryHeap<Record, C> {
fn push(&mut self, record: Record) {
BinaryHeap::push(self, record)
}

fn pop(&mut self) -> Option<Record> {
BinaryHeap::pop(self)
}

fn is_empty(&self) -> bool {
BinaryHeap::is_empty(self)
}
}

#[derive(new)]
pub struct SubSort<
Input: FallibleIterator<Item = Record, Error = Error>,
Expand Down Expand Up @@ -328,7 +306,7 @@ mod tests {
fn should_sort_stream(#[case] slice_size: usize) {
#[derive(Debug)]
enum Error {
Bincode(bincode::Error),
Bincode(#[allow(dead_code)] bincode::Error),
}

impl From<bincode::Error> for Error {
Expand Down Expand Up @@ -377,7 +355,7 @@ mod tests {
fn should_sort_big_stream(#[case] slice_size: usize) {
#[derive(Debug)]
enum Error {
Bincode(bincode::Error),
Bincode(#[allow(dead_code)] bincode::Error),
}

impl From<bincode::Error> for Error {
Expand Down
4 changes: 2 additions & 2 deletions quirky_binder_support/src/iterator/sync/mpsc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ mod tests {
use std::sync::mpsc::channel;

#[derive(Debug)]
struct Error(String);
struct Error(#[allow(dead_code)] String);

impl From<RecvError> for Error {
fn from(_: RecvError) -> Self {
Expand All @@ -69,7 +69,7 @@ mod tests {
use std::sync::mpsc::sync_channel;

#[derive(Debug)]
struct Error(String);
struct Error(#[allow(dead_code)] String);

impl From<RecvError> for Error {
fn from(_: RecvError) -> Self {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ use quirky_binder::{
println!("Seed: {:02x?}", rng.get_seed());

let nums = (0..1024)
.into_iter()
.map(|_| rng.gen())
.collect::<BTreeSet<i8>>();
for num in nums {
Expand Down Expand Up @@ -51,7 +50,6 @@ use quirky_binder::{
println!("Seed: {:02x?}", rng.get_seed());

let nums = (0..1024)
.into_iter()
.map(|_| rng.gen())
.collect::<BTreeSet<i8>>();
for num in nums {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ use quirky_binder::{
println!("Seed: {:02x?}", rng.get_seed());

let nums = (0..1024)
.into_iter()
.map(|_| rng.gen())
.collect::<BTreeSet<i8>>();
for num in nums {
Expand Down Expand Up @@ -51,7 +50,6 @@ use quirky_binder::{
println!("Seed: {:02x?}", rng.get_seed());

let nums = (0..1024)
.into_iter()
.map(|_| rng.gen())
.collect::<BTreeSet<i8>>();
for num in nums {
Expand Down

0 comments on commit 8e8dfa4

Please sign in to comment.