From c4781ee65397b3c482b9ca089b90ea008fde420a Mon Sep 17 00:00:00 2001 From: startewho Date: Fri, 8 Sep 2023 15:37:29 +0800 Subject: [PATCH] spell error --- README.md | 6 +++--- csbindgen/src/parser.rs | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 3828c71..3682e04 100644 --- a/README.md +++ b/README.md @@ -172,7 +172,7 @@ csbindgen::Builder::default() .csharp_use_function_pointer(true) // optional, default: true .csharp_disable_emit_dll_name(false) // optional, default: false .csharp_imported_namespaces("MyLib") // optional, default: empty - .csharp_generate_const_fliter (|_|false) // optional, default: `|_|false` + .csharp_generate_const_filter (|_|false) // optional, default: `|_|false` .csharp_dll_name_if("UNITY_IOS && !UNITY_EDITOR", "__Internal") // optional, default: "" .generate_csharp_file("../dotnet-sandbox/NativeMethods.cs") // required .unwrap(); @@ -196,7 +196,7 @@ namespace {csharp_namespace} #endif } - {csharp_generate_const_fliter} + {csharp_generate_const_filter} [DllImport(__DllName, EntryPoint = "{csharp_entry_point_prefix}LZ4_versionNumber", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public static extern int {csharp_method_prefix}LZ4_versionNumber(); @@ -207,7 +207,7 @@ namespace {csharp_namespace} `csharp_disable_emit_dll_name` is optional, if set to true then don't emit `const string __DllName`. It is useful for generate same class-name from different builder. -`csharp_generate_const_fliter` is optional, if set a fliter fun, then generate fliter C# `const` field from Rust `const`. +`csharp_generate_const_filter` is optional, if set a fliter fun, then generate filter C# `const` field from Rust `const`. `input_extern_file` and `input_bindgen_file` allow mulitple call, if you need to add dependent struct, use this. diff --git a/csbindgen/src/parser.rs b/csbindgen/src/parser.rs index 1a737d4..04ad215 100644 --- a/csbindgen/src/parser.rs +++ b/csbindgen/src/parser.rs @@ -251,12 +251,12 @@ fn collect_fields_unnamed(fields: &syn::FieldsUnnamed) -> Vec { result } -pub fn collect_const(ast: &syn::File, result: &mut Vec,fliter:fn(const_name: &str) -> bool) { +pub fn collect_const(ast: &syn::File, result: &mut Vec,filter:fn(const_name: &str) -> bool) { for item in depth_first_module_walk(&ast.items) { if let Item::Const(ct) = item { // pub const Ident: ty = expr let const_name = ct.ident.to_string(); - if fliter(const_name.as_str()) { + if filter(const_name.as_str()) { let t = parse_type(&ct.ty);