From 05d4b8967d426678d832b47f13c80984394d0d6c Mon Sep 17 00:00:00 2001 From: Trim21 Date: Fri, 27 Dec 2024 09:08:18 +0800 Subject: [PATCH] comment --- dev/src/generate/binding_python.rs | 21 ++++++--------------- 1 file changed, 6 insertions(+), 15 deletions(-) diff --git a/dev/src/generate/binding_python.rs b/dev/src/generate/binding_python.rs index a95609b8e772..864f5ae43672 100644 --- a/dev/src/generate/binding_python.rs +++ b/dev/src/generate/binding_python.rs @@ -49,6 +49,7 @@ pub fn generate(project_root: PathBuf, services: &Services) -> Result<()> { .filter(|x| enabled_service(x.0.as_str())), ); + // move required options at beginning. for srv in &mut v { srv.1.config = srv .1 @@ -85,25 +86,15 @@ pub fn generate(project_root: PathBuf, services: &Services) -> Result<()> { impl ConfigType { pub fn python_type(&self) -> String { match self { - ConfigType::Bool => { - "_bool".into() - } - ConfigType::Duration => { - "_duration".into() - } + ConfigType::Bool => "_bool".into(), + ConfigType::Duration => "_duration".into(), ConfigType::I64 | ConfigType::Usize | ConfigType::U64 | ConfigType::U32 - | ConfigType::U16 => { - "_int".into() - } - ConfigType::Vec => { - "_strings".into() - } - ConfigType::String => { - "str".into() - } + | ConfigType::U16 => "_int".into(), + ConfigType::Vec => "_strings".into(), + ConfigType::String => "str".into(), } } }