diff --git a/plugins/opencad-python/build/generate.rs b/plugins/opencad-python/build/generate.rs index 88043c48e..716bc8566 100644 --- a/plugins/opencad-python/build/generate.rs +++ b/plugins/opencad-python/build/generate.rs @@ -587,6 +587,7 @@ fn gen_unit_enum(name: &str, info: &TypeInfo) -> String { {name_arms} }} }} +#[allow(dead_code)] fn str_to_{snake}(value: String, vm: &VirtualMachine) -> PyResult<{path}> {{ match value.as_str() {{ {parse_arms} other => Err(vm.new_value_error(format!("ocs: unsupported {name} value: {{other}}"))), @@ -656,6 +657,7 @@ fn gen_tagged_enum(name: &str, info: &TypeInfo, registry: &TypeRegistry) -> Stri {to_arms} }} }} +#[allow(dead_code)] fn dict_to_{snake}(value: PyObjectRef, vm: &VirtualMachine) -> PyResult<{path}> {{ let dict = value.try_into_value::(vm)?; let kind = dict.get_item("kind", vm)?.try_into_value::(vm)?; @@ -732,6 +734,7 @@ fn gen_struct(name: &str, info: &TypeInfo, registry: &TypeRegistry, required: &[ {to_dict_body} Ok(dict.into()) }} +#[allow(dead_code)] fn dict_to_{snake}(value: PyObjectRef, vm: &VirtualMachine) -> PyResult<{path}> {{ let dict = value.try_into_value::(vm)?; let allowed: &[&str] = &[{allowed_list}]; diff --git a/src/app/plugin_host.rs b/src/app/plugin_host.rs index a94c9f01c..6f56798df 100644 --- a/src/app/plugin_host.rs +++ b/src/app/plugin_host.rs @@ -7100,7 +7100,7 @@ mod tests { let mut app = OpenCADStudio::new_for_test(); app.tabs[0].is_start = false; let mut host = HostSession::new(&mut app, 0); - let mut object = |host: &mut HostSession<'_>, data: ClassObjectData| { + let object = |host: &mut HostSession<'_>, data: ClassObjectData| { let handle = host.document_mut().allocate_handle(); let mut class_object = ClassObject::new(data); class_object.handle = handle; @@ -7340,7 +7340,7 @@ mod tests { std::path::Path::new(&plugin_path), &mut host, crate::plugin::v4_support::notification_handler(), ).unwrap(); let dir = std::env::temp_dir(); - let mut run = |host: &mut HostSession<'_>, tag: &str, body: &str| { + let run = |host: &mut HostSession<'_>, tag: &str, body: &str| { let script = dir.join(format!("ocs_layers_{tag}_{}.py", std::process::id())); std::fs::write(&script, format!(concat!( "def P(x, y, z): return {{'x': x, 'y': y, 'z': z}}\n",