mirror of
https://github.com/AppFlowy-IO/AppFlowy.git
synced 2024-08-30 18:12:39 +00:00
style: fix warnings
This commit is contained in:
@ -15,7 +15,7 @@ impl DartEventCodeGen {
|
||||
let event_crates = parse_dart_event_files(self.rust_sources.clone());
|
||||
let event_ast = event_crates
|
||||
.iter()
|
||||
.map(|event_crate| parse_event_crate(event_crate))
|
||||
.map(parse_event_crate)
|
||||
.flatten()
|
||||
.collect::<Vec<_>>();
|
||||
|
||||
@ -62,7 +62,7 @@ pub fn parse_dart_event_files(roots: Vec<String>) -> Vec<DartEventCrate> {
|
||||
.into_iter()
|
||||
.filter_entry(|e| !is_hidden(e))
|
||||
.filter_map(|e| e.ok())
|
||||
.filter(|e| is_crate_dir(e))
|
||||
.filter(is_crate_dir)
|
||||
.flat_map(|e| parse_crate_config_from(&e))
|
||||
.map(|crate_config| DartEventCrate::from_config(&crate_config))
|
||||
.collect::<Vec<DartEventCrate>>();
|
||||
|
@ -10,7 +10,7 @@ fn main() {
|
||||
|
||||
let matches = app().get_matches();
|
||||
|
||||
if let Some(ref matches) = matches.subcommand_matches("pb-gen") {
|
||||
if let Some(matches) = matches.subcommand_matches("pb-gen") {
|
||||
let rust_sources: Vec<String> = matches
|
||||
.values_of("rust_sources")
|
||||
.unwrap()
|
||||
@ -27,7 +27,7 @@ fn main() {
|
||||
.gen();
|
||||
}
|
||||
|
||||
if let Some(ref matches) = matches.subcommand_matches("dart-event") {
|
||||
if let Some(matches) = matches.subcommand_matches("dart-event") {
|
||||
let rust_sources: Vec<String> = matches
|
||||
.values_of("rust_sources")
|
||||
.unwrap()
|
||||
|
@ -59,7 +59,7 @@ fn parse_files_protobuf(proto_crate_path: &str, proto_output_dir: &str) -> Vec<P
|
||||
.iter()
|
||||
.filter(|f| f.attrs.pb_index().is_some())
|
||||
.for_each(|f| {
|
||||
struct_template.set_field(&f);
|
||||
struct_template.set_field(f);
|
||||
});
|
||||
|
||||
let s = struct_template.render().unwrap();
|
||||
@ -70,7 +70,7 @@ fn parse_files_protobuf(proto_crate_path: &str, proto_output_dir: &str) -> Vec<P
|
||||
let enums = get_ast_enums(&ast);
|
||||
enums.iter().for_each(|e| {
|
||||
let mut enum_template = EnumTemplate::new();
|
||||
enum_template.set_message_enum(&e);
|
||||
enum_template.set_message_enum(e);
|
||||
let s = enum_template.render().unwrap();
|
||||
proto_file_content.push_str(s.as_ref());
|
||||
proto_file_content.push('\n');
|
||||
|
Reference in New Issue
Block a user