forked from 1b-agent/opencadstudio-upstream
chore: clear compiler warnings introduced by the Python host work
Drop two unneeded mut bindings in tests and mark the generated dict/enum converters allow(dead_code), since a kind can leave one unused. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
1 parent
8eb85dab8d
commit
a25ae4f8c0
2 files changed
+5
-2
No files matched your search
@@ -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::<rustpython_vm::builtins::PyDictRef>(vm)?;
|
||||
let kind = dict.get_item("kind", vm)?.try_into_value::<String>(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::<rustpython_vm::builtins::PyDictRef>(vm)?;
|
||||
let allowed: &[&str] = &[{allowed_list}];
|
||||
|
||||
Reference in new issue
Block a user