mirror of
				https://github.com/pcvolkmer/osc-variant.git
				synced 2025-10-31 00:16:11 +00:00 
			
		
		
		
	Extract print function for catalogues and forms
This commit is contained in:
		| @@ -60,42 +60,16 @@ impl OnkostarEditor { | |||||||
|             style(&self.info_xml.name).yellow(), |             style(&self.info_xml.name).yellow(), | ||||||
|             style(&self.info_xml.version).yellow() |             style(&self.info_xml.version).yellow() | ||||||
|         ); |         ); | ||||||
|         println!( |         Self::print_items("Merkmalskataloge", &self.editor.property_catalogue); | ||||||
|             "{} {}", |         Self::print_items("Datenkataloge", &self.editor.data_catalogue); | ||||||
|             self.editor.property_catalogue.len(), |         Self::print_items("Formulare", &self.editor.data_form); | ||||||
|             style("Merkmalskataloge").underlined() |         Self::print_items("Unterformulare", &self.editor.unterformular); | ||||||
|         ); |     } | ||||||
|         self.editor |  | ||||||
|             .property_catalogue |     fn print_items(title: &str, list: &[impl Listable]) { | ||||||
|             .iter() |         println!("\n{} {}", list.len(), style(title).underlined()); | ||||||
|             .for_each(|data_form| println!("{}", data_form.to_listed_string())); |         list.iter() | ||||||
|         println!( |             .for_each(|entry| println!("{}", entry.to_listed_string())); | ||||||
|             "\n{} {}", |  | ||||||
|             self.editor.data_catalogue.len(), |  | ||||||
|             style("Datenkataloge").underlined() |  | ||||||
|         ); |  | ||||||
|         self.editor |  | ||||||
|             .data_catalogue |  | ||||||
|             .iter() |  | ||||||
|             .for_each(|data_form| println!("{}", data_form.to_listed_string())); |  | ||||||
|         println!( |  | ||||||
|             "\n{} {}", |  | ||||||
|             self.editor.data_form.len(), |  | ||||||
|             style("Formulare").underlined() |  | ||||||
|         ); |  | ||||||
|         self.editor |  | ||||||
|             .data_form |  | ||||||
|             .iter() |  | ||||||
|             .for_each(|data_form| println!("{}", data_form.to_listed_string())); |  | ||||||
|         println!( |  | ||||||
|             "\n{} {}", |  | ||||||
|             self.editor.unterformular.len(), |  | ||||||
|             style("Unterformulare").underlined() |  | ||||||
|         ); |  | ||||||
|         self.editor |  | ||||||
|             .unterformular |  | ||||||
|             .iter() |  | ||||||
|             .for_each(|data_form| println!("{}", data_form.to_listed_string())); |  | ||||||
|     } |     } | ||||||
| } | } | ||||||
|  |  | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user