[niepce] rust: add target to run clippy. Avoid warnings from bindings



commit 5140bfd2b60b0cababba536e964203ad7026596b
Author: Hubert Figuière <hub figuiere net>
Date:   Tue Jan 7 00:24:43 2020 -0500

    rust: add target to run clippy. Avoid warnings from bindings
    
    - also avoid warnings for usnsafe documentation

 Makefile.am                  | 2 ++
 crates/npc-engine/src/lib.rs | 8 ++++++--
 src/Makefile.am              | 4 ++++
 3 files changed, 12 insertions(+), 2 deletions(-)
---
diff --git a/Makefile.am b/Makefile.am
index f887a31..cbcbcde 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -7,3 +7,5 @@ EXTRA_DIST = COPYING AUTHORS README \
 SUBDIRS =  data third_party src po
 DIST_SUBDIRS = po art data doc src
 
+clippy:
+       make -C src clippy
diff --git a/crates/npc-engine/src/lib.rs b/crates/npc-engine/src/lib.rs
index 71bd899..1f5f182 100644
--- a/crates/npc-engine/src/lib.rs
+++ b/crates/npc-engine/src/lib.rs
@@ -1,7 +1,7 @@
 /*
  * niepce - engine/mod.rs
  *
- * Copyright (C) 2017-2019 Hubert Figuière
+ * Copyright (C) 2017-2020 Hubert Figuière
  *
  * This program is free software: you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -26,4 +26,8 @@ extern crate npc_fwk;
 pub mod db;
 pub mod library;
 
-include!(concat!(env!("OUT_DIR"), "/bindings.rs"));
+#[allow(clippy::all)]
+mod bindings {
+    include!(concat!(env!("OUT_DIR"), "/bindings.rs"));
+}
+pub use bindings::*;
diff --git a/src/Makefile.am b/src/Makefile.am
index 64fa431..b71b7ab 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -86,3 +86,7 @@ clean-local:
 check-local:
        cd $(top_srcdir) && \
        CARGO_TARGET_DIR=$(CARGO_TARGET_DIR) cargo test $(CARGO_VERBOSE) $(CARGO_RELEASE_ARGS)
+
+clippy:
+       cd $(top_srcdir) && \
+       CARGO_TARGET_DIR=$(CARGO_TARGET_DIR) cargo clippy $(CARGO_VERBOSE) $(CARGO_RELEASE_ARGS) -- -A 
clippy::missing_safety_doc


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]