mirror of
https://gitlab.cern.ch/wotsubo/endcap-sl-software-ri-generator.git
synced 2025-02-23 00:57:08 +09:00
clippy lint
This commit is contained in:
parent
6ff047563c
commit
76310c64a3
1 changed files with 4 additions and 9 deletions
|
@ -15,7 +15,6 @@ use crate::{
|
||||||
types::{Block, Module, ModuleBlockElements, Register},
|
types::{Block, Module, ModuleBlockElements, Register},
|
||||||
};
|
};
|
||||||
use heck::{ToSnakeCase, ToUpperCamelCase};
|
use heck::{ToSnakeCase, ToUpperCamelCase};
|
||||||
use itertools::Itertools;
|
|
||||||
use proc_macro2::TokenStream;
|
use proc_macro2::TokenStream;
|
||||||
use quote::quote;
|
use quote::quote;
|
||||||
use thiserror::Error;
|
use thiserror::Error;
|
||||||
|
@ -201,10 +200,8 @@ impl CodeGen for Block {
|
||||||
parent_path: Option<path::PathBuf>,
|
parent_path: Option<path::PathBuf>,
|
||||||
mut files: HashMap<path::PathBuf, proc_macro2::TokenStream>,
|
mut files: HashMap<path::PathBuf, proc_macro2::TokenStream>,
|
||||||
) -> Result<HashMap<path::PathBuf, proc_macro2::TokenStream>, CodeGenError> {
|
) -> Result<HashMap<path::PathBuf, proc_macro2::TokenStream>, CodeGenError> {
|
||||||
let parent_name =
|
let parent_name = parent_name.ok_or(CodeGenError::ParentMissing { module: "Block" })?;
|
||||||
parent_name.ok_or_else(|| CodeGenError::ParentMissing { module: "Block" })?;
|
let parent_path = parent_path.ok_or(CodeGenError::ParentMissing { module: "Block" })?;
|
||||||
let parent_path =
|
|
||||||
parent_path.ok_or_else(|| CodeGenError::ParentMissing { module: "Block" })?;
|
|
||||||
|
|
||||||
let snake_case_name = util::parse_to_ident(&self.name.to_snake_case())?;
|
let snake_case_name = util::parse_to_ident(&self.name.to_snake_case())?;
|
||||||
let upper_camel_name = util::parse_to_ident(&self.name.to_upper_camel_case())?;
|
let upper_camel_name = util::parse_to_ident(&self.name.to_upper_camel_case())?;
|
||||||
|
@ -324,10 +321,8 @@ impl CodeGen for Register {
|
||||||
parent_path: Option<path::PathBuf>,
|
parent_path: Option<path::PathBuf>,
|
||||||
mut files: HashMap<path::PathBuf, proc_macro2::TokenStream>,
|
mut files: HashMap<path::PathBuf, proc_macro2::TokenStream>,
|
||||||
) -> Result<HashMap<path::PathBuf, proc_macro2::TokenStream>, CodeGenError> {
|
) -> Result<HashMap<path::PathBuf, proc_macro2::TokenStream>, CodeGenError> {
|
||||||
let parent_name =
|
let parent_name = parent_name.ok_or(CodeGenError::ParentMissing { module: "Block" })?;
|
||||||
parent_name.ok_or_else(|| CodeGenError::ParentMissing { module: "Block" })?;
|
let parent_path = parent_path.ok_or(CodeGenError::ParentMissing { module: "Block" })?;
|
||||||
let parent_path =
|
|
||||||
parent_path.ok_or_else(|| CodeGenError::ParentMissing { module: "Block" })?;
|
|
||||||
|
|
||||||
let snake_case_name = util::parse_to_ident(&self.name.to_snake_case())?;
|
let snake_case_name = util::parse_to_ident(&self.name.to_snake_case())?;
|
||||||
let upper_camel_name = util::parse_to_ident(&self.name.to_upper_camel_case())?;
|
let upper_camel_name = util::parse_to_ident(&self.name.to_upper_camel_case())?;
|
||||||
|
|
Loading…
Reference in a new issue