This is an automated email from the ASF dual-hosted git repository.

mgrigorov pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/avro-rs.git


The following commit(s) were added to refs/heads/main by this push:
     new 2f5f1e9  chore: Disable the build of TestLogger for WASM32 (#426)
2f5f1e9 is described below

commit 2f5f1e973558194a6858fbb2ff4b70104b05204f
Author: Martin Grigorov <[email protected]>
AuthorDate: Fri Jan 23 13:48:37 2026 +0200

    chore: Disable the build of TestLogger for WASM32 (#426)
    
    Until now only the install() function was not compiled for WASM32 and
    this led to the following warning at build time:
    
    ```
    warning: struct `TestLogger` is never constructed
      --> avro_test_helper/src/logger.rs:22:8
       |
    22 | struct TestLogger {
       |        ^^^^^^^^^^
       |
       = note: `#[warn(dead_code)]` (part of `#[warn(unused)]`) on by default
    
    warning: function `test_logger` is never used
      --> avro_test_helper/src/logger.rs:43:4
       |
    43 | fn test_logger() -> &'static TestLogger {
       |    ^^^^^^^^^^^
    
    warning: `apache-avro-test-helper` (lib) generated 2 warnings
    ```
---
 avro_test_helper/src/logger.rs | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/avro_test_helper/src/logger.rs b/avro_test_helper/src/logger.rs
index 8617358..fe83238 100644
--- a/avro_test_helper/src/logger.rs
+++ b/avro_test_helper/src/logger.rs
@@ -15,6 +15,8 @@
 // specific language governing permissions and limitations
 // under the License.
 
+#![cfg(not(target_arch = "wasm32"))]
+
 use crate::LOG_MESSAGES;
 use log::{LevelFilter, Log, Metadata};
 use std::sync::OnceLock;
@@ -85,7 +87,6 @@ pub fn assert_logged(expected_message: &str) {
     }
 }
 
-#[cfg(not(target_arch = "wasm32"))]
 pub(crate) fn install() {
     log::set_logger(test_logger())
         .map(|_| log::set_max_level(LevelFilter::Trace))

Reply via email to