Skip to content

Apache DataFusion SQL Query Engine

ARROW-2408: [Rust] Remove build warnings

Maximilian Roos3904c8bb4881
diff --git a/ci/travis_script_rust.sh b/ci/travis_script_rust.sh
index 4405d036d6..6a8ecf081e 100755
--- a/ci/travis_script_rust.sh
+++ b/ci/travis_script_rust.sh
@@ -23,8 +23,12 @@ RUST_DIR=${TRAVIS_BUILD_DIR}/rust
pushd $RUST_DIR
+# raises on any formatting errors
rustup component add rustfmt-preview
cargo fmt --all -- --write-mode=diff
+# raises on any warnings
+cargo rustc -- -D warnings
+
cargo build
cargo test
diff --git a/rust/examples/array_from_builder.rs b/rust/examples/array_from_builder.rs
index 3a273a64dc..ea1ecec45f 100644
--- a/rust/examples/array_from_builder.rs
+++ b/rust/examples/array_from_builder.rs
@@ -18,7 +18,6 @@
extern crate arrow;
use arrow::array::*;
-use arrow::buffer::*;
use arrow::builder::*;
fn main() {
diff --git a/rust/src/buffer.rs b/rust/src/buffer.rs
index ab90a5b082..1f2ec6c8da 100644
--- a/rust/src/buffer.rs
+++ b/rust/src/buffer.rs
@@ -18,7 +18,6 @@
use bytes::Bytes;
use libc;
use std::mem;
-use std::ptr;
use std::slice;
use super::memory::*;
diff --git a/rust/src/builder.rs b/rust/src/builder.rs
index 1cc024042f..c8ba27477d 100644
--- a/rust/src/builder.rs
+++ b/rust/src/builder.rs
@@ -15,11 +15,9 @@
// specific language governing permissions and limitations
// under the License.
-use bytes::Bytes;
use libc;
use std::mem;
use std::ptr;
-use std::slice;
use super::buffer::*;
use super::memory::*;
diff --git a/rust/src/datatypes.rs b/rust/src/datatypes.rs
index 85278f7bb7..ac2c2c6ea2 100644
--- a/rust/src/datatypes.rs
+++ b/rust/src/datatypes.rs
@@ -16,7 +16,6 @@
// under the License.
use super::error::ArrowError;
-use serde_json;
use serde_json::Value;
use std::fmt;
@@ -241,6 +240,7 @@ impl fmt::Display for Schema {
#[cfg(test)]
mod tests {
use super::*;
+ use serde_json;
#[test]
fn create_struct_type() {