feat: clippy
Signed-off-by: kjuulh <contact@kjuulh.io>
This commit is contained in:
parent
8beaeb53d7
commit
ca7c0c5c09
@ -1,6 +1,6 @@
|
||||
mod logging;
|
||||
|
||||
use std::path::{Path, PathBuf};
|
||||
use std::path::{PathBuf};
|
||||
|
||||
use anyhow::anyhow;
|
||||
use clap::{Args, Parser, Subcommand};
|
||||
|
@ -32,7 +32,7 @@ impl Node {
|
||||
let file_name_content = file_name_content.file_stem().unwrap();
|
||||
let file_name_content = file_name_content.to_string_lossy().to_lowercase();
|
||||
|
||||
let segments = file_name_content.split(".").collect::<Vec<_>>();
|
||||
let segments = file_name_content.split('.').collect::<Vec<_>>();
|
||||
for (i, segment) in segments.iter().enumerate() {
|
||||
node = node.children.entry(segment.to_string()).or_insert_with(|| {
|
||||
Node::new(
|
||||
@ -214,10 +214,10 @@ impl Codegen {
|
||||
let result: anyhow::Result<()> = handle.await?;
|
||||
result?;
|
||||
|
||||
let mut output_paths = self.discover_files(&out_tempdir_path, "rs")?;
|
||||
let mut output_paths = self.discover_files(out_tempdir_path, "rs")?;
|
||||
|
||||
let mod_path = self
|
||||
.generate_mod_file(&out_tempdir_path, &output_paths)
|
||||
.generate_mod_file(out_tempdir_path, &output_paths)
|
||||
.await?;
|
||||
output_paths.push(mod_path);
|
||||
|
||||
|
@ -37,7 +37,7 @@ impl crunch::traits::Event for SomeEvent {
|
||||
async fn main() -> anyhow::Result<()> {
|
||||
tracing_subscriber::fmt::init();
|
||||
|
||||
let crunch = crunch::builder::Builder::default().build()?;
|
||||
let crunch = crunch::Builder::default().build()?;
|
||||
crunch
|
||||
.subscribe(move |item: SomeEvent| async move {
|
||||
tracing::info!(
|
||||
|
@ -37,7 +37,7 @@ impl crunch::traits::Event for SomeEvent {
|
||||
async fn main() -> anyhow::Result<()> {
|
||||
tracing_subscriber::fmt::init();
|
||||
|
||||
let crunch = crunch::builder::Builder::default().build()?;
|
||||
let crunch = crunch::Builder::default().build()?;
|
||||
let counter = std::sync::Arc::new(std::sync::atomic::AtomicUsize::new(0));
|
||||
|
||||
let inner_counter = counter.clone();
|
||||
|
@ -13,7 +13,7 @@ pub mod basic {
|
||||
where
|
||||
Self: Sized,
|
||||
{
|
||||
let output = Self::decode(raw.as_slice()).map_err(|e| ::crunch::errors::DeserializeError::ProtoErr(e))?;
|
||||
let output = Self::decode(raw.as_slice()).map_err(::crunch::errors::DeserializeError::ProtoErr)?;
|
||||
Ok(output)
|
||||
}
|
||||
}
|
||||
@ -42,7 +42,7 @@ pub mod basic {
|
||||
where
|
||||
Self: Sized,
|
||||
{
|
||||
let output = Self::decode(raw.as_slice()).map_err(|e| ::crunch::errors::DeserializeError::ProtoErr(e))?;
|
||||
let output = Self::decode(raw.as_slice()).map_err(::crunch::errors::DeserializeError::ProtoErr)?;
|
||||
Ok(output)
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user