From 442b65cdbe0c22d197d786883d76c6b0541223b6 Mon Sep 17 00:00:00 2001 From: Tim Weis Date: Mon, 2 Dec 2024 20:10:05 +0100 Subject: [PATCH 1/3] code page * Makes the project information's `code_page` field public. This enables clients to perform conversions to Unicode. --- Cargo.toml | 8 ++------ src/lib.rs | 4 +++- 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index e06461a..69b3815 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,14 +1,10 @@ [package] name = "ovba" -version = "0.4.1" +version = "0.5.0" authors = ["Tim Weis "] description = "An Office VBA project parser written in 100% safe Rust." edition = "2018" -exclude = [ - ".gitignore", - "docs/dev/**", - ".github/**" -] +exclude = [".gitignore", "docs/dev/**", ".github/**"] license-file = "LICENSE" repository = "https://github.com/tim-weis/ovba" documentation = "https://docs.rs/ovba" diff --git a/src/lib.rs b/src/lib.rs index 26369bf..3a2ef16 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -176,7 +176,9 @@ pub struct Information { pub sys_kind: SysKind, lcid: u32, lcid_invoke: u32, - code_page: u16, + /// Specifies the code page for the VBA project. + /// + pub code_page: u16, name: String, doc_string: String, help_file_1: String, From 6734b3f7fa77e2ceb65df0e06853109501b6cab3 Mon Sep 17 00:00:00 2001 From: Tim Weis Date: Mon, 2 Dec 2024 20:24:09 +0100 Subject: [PATCH 2/3] clippy --- src/lib.rs | 23 ++++++++++------------- src/parser.rs | 20 ++++++++++---------- 2 files changed, 20 insertions(+), 23 deletions(-) diff --git a/src/lib.rs b/src/lib.rs index 3a2ef16..77a5865 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -166,27 +166,24 @@ pub enum Reference { Project(ReferenceProject), } -// TODO: Remove exemption once the implementation is complete. -#[allow(dead_code)] - /// Specifies version-independent information for the VBA project. #[derive(Debug)] pub struct Information { /// Specifies the platform for which the VBA project is created. pub sys_kind: SysKind, - lcid: u32, - lcid_invoke: u32, + _lcid: u32, + _lcid_invoke: u32, /// Specifies the code page for the VBA project. /// pub code_page: u16, - name: String, - doc_string: String, - help_file_1: String, - help_context: u32, - lib_flags: u32, - version_major: u32, - version_minor: u16, - constants: String, + _name: String, + _doc_string: String, + _help_file_1: String, + _help_context: u32, + _lib_flags: u32, + _version_major: u32, + _version_minor: u16, + _constants: String, } /// Specifies the containing module's type. diff --git a/src/parser.rs b/src/parser.rs index 7bb5b35..2a79aa4 100644 --- a/src/parser.rs +++ b/src/parser.rs @@ -604,17 +604,17 @@ pub(crate) fn parse_project_information( ProjectInformation { information: Information { sys_kind, - lcid, - lcid_invoke, + _lcid: lcid, + _lcid_invoke: lcid_invoke, code_page, - name, - doc_string, - help_file_1, - help_context, - lib_flags, - version_major, - version_minor, - constants, + _name: name, + _doc_string: doc_string, + _help_file_1: help_file_1, + _help_context: help_context, + _lib_flags: lib_flags, + _version_major: version_major, + _version_minor: version_minor, + _constants: constants, }, references, modules, From 8769b09154e370d767e355e0803637f576b38f56 Mon Sep 17 00:00:00 2001 From: Tim Weis Date: Mon, 2 Dec 2024 20:31:15 +0100 Subject: [PATCH 3/3] clippy --- src/lib.rs | 26 ++++++++++++-------------- src/parser.rs | 20 ++++++++++---------- 2 files changed, 22 insertions(+), 24 deletions(-) diff --git a/src/lib.rs b/src/lib.rs index 77a5865..e61c341 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -102,7 +102,6 @@ pub enum SysKind { // TODO: Remove exemption once the implementation is complete. #[allow(dead_code)] - /// Specifies a reference to a twiddled type library and its extended type library. #[derive(Debug)] pub struct ReferenceControl { @@ -120,7 +119,6 @@ pub struct ReferenceControl { // TODO: Remove exemption once the implementation is complete. #[allow(dead_code)] - /// Specifies the identifier of the Automation type library the containing /// [`ReferenceControl`]'s twiddled type library was generated from. #[derive(Debug)] @@ -132,7 +130,6 @@ pub struct ReferenceOriginal { // TODO: Remove exemption once the implementation is complete. #[allow(dead_code)] - /// Specifies a reference to an Automation type library. #[derive(Debug)] pub struct ReferenceRegistered { @@ -142,7 +139,6 @@ pub struct ReferenceRegistered { // TODO: Remove exemption once the implementation is complete. #[allow(dead_code)] - /// Specifies a reference to an external VBA project. #[derive(Debug)] pub struct ReferenceProject { @@ -166,24 +162,26 @@ pub enum Reference { Project(ReferenceProject), } +// TODO: Remove exemption once the implementation is complete. +#[allow(dead_code)] /// Specifies version-independent information for the VBA project. #[derive(Debug)] pub struct Information { /// Specifies the platform for which the VBA project is created. pub sys_kind: SysKind, - _lcid: u32, - _lcid_invoke: u32, + lcid: u32, + lcid_invoke: u32, /// Specifies the code page for the VBA project. /// pub code_page: u16, - _name: String, - _doc_string: String, - _help_file_1: String, - _help_context: u32, - _lib_flags: u32, - _version_major: u32, - _version_minor: u16, - _constants: String, + name: String, + doc_string: String, + help_file_1: String, + help_context: u32, + lib_flags: u32, + version_major: u32, + version_minor: u16, + constants: String, } /// Specifies the containing module's type. diff --git a/src/parser.rs b/src/parser.rs index 2a79aa4..7bb5b35 100644 --- a/src/parser.rs +++ b/src/parser.rs @@ -604,17 +604,17 @@ pub(crate) fn parse_project_information( ProjectInformation { information: Information { sys_kind, - _lcid: lcid, - _lcid_invoke: lcid_invoke, + lcid, + lcid_invoke, code_page, - _name: name, - _doc_string: doc_string, - _help_file_1: help_file_1, - _help_context: help_context, - _lib_flags: lib_flags, - _version_major: version_major, - _version_minor: version_minor, - _constants: constants, + name, + doc_string, + help_file_1, + help_context, + lib_flags, + version_major, + version_minor, + constants, }, references, modules,