Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion ci/travis_script_rust.sh
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ pushd $RUST_DIR

# raises on any formatting errors
rustup component add rustfmt-preview
cargo fmt --all -- --write-mode=diff
cargo fmt --all -- --check
# raises on any warnings
cargo rustc -- -D warnings

Expand Down
7 changes: 2 additions & 5 deletions rust/src/array.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@
use std::any::Any;
use std::convert::From;
use std::ops::Add;
use std::sync::Arc;
use std::str;
use std::string::String;
use std::sync::Arc;

use super::bitmap::Bitmap;
use super::buffer::*;
Expand Down Expand Up @@ -453,12 +453,9 @@ mod tests {
fn test_access_array_concurrently() {
let a = PrimitiveArray::from(Buffer::from(vec![5, 6, 7, 8, 9]));

let ret = thread::spawn(move || {
a.iter().collect::<Vec<i32>>()
}).join();
let ret = thread::spawn(move || a.iter().collect::<Vec<i32>>()).join();

assert!(ret.is_ok());
assert_eq!(vec![5, 6, 7, 8, 9], ret.ok().unwrap());
}
}

15 changes: 10 additions & 5 deletions rust/src/buffer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,8 @@ mod tests {
fn test_buffer_eq() {
let a = Buffer::from(vec![1, 2, 3, 4, 5]);
let b = Buffer::from(vec![5, 4, 3, 2, 1]);
let c = a.iter()
let c = a
.iter()
.zip(b.iter())
.map(|(a, b)| a == b)
.collect::<Vec<bool>>();
Expand All @@ -201,7 +202,8 @@ mod tests {
fn test_buffer_lt() {
let a = Buffer::from(vec![1, 2, 3, 4, 5]);
let b = Buffer::from(vec![5, 4, 3, 2, 1]);
let c = a.iter()
let c = a
.iter()
.zip(b.iter())
.map(|(a, b)| a < b)
.collect::<Vec<bool>>();
Expand All @@ -212,7 +214,8 @@ mod tests {
fn test_buffer_gt() {
let a = Buffer::from(vec![1, 2, 3, 4, 5]);
let b = Buffer::from(vec![5, 4, 3, 2, 1]);
let c = a.iter()
let c = a
.iter()
.zip(b.iter())
.map(|(a, b)| a > b)
.collect::<Vec<bool>>();
Expand All @@ -223,7 +226,8 @@ mod tests {
fn test_buffer_add() {
let a = Buffer::from(vec![1, 2, 3, 4, 5]);
let b = Buffer::from(vec![5, 4, 3, 2, 1]);
let c = a.iter()
let c = a
.iter()
.zip(b.iter())
.map(|(a, b)| a + b)
.collect::<Vec<i32>>();
Expand All @@ -234,7 +238,8 @@ mod tests {
fn test_buffer_multiply() {
let a = Buffer::from(vec![1, 2, 3, 4, 5]);
let b = Buffer::from(vec![5, 4, 3, 2, 1]);
let c = a.iter()
let c = a
.iter()
.zip(b.iter())
.map(|(a, b)| a * b)
.collect::<Vec<i32>>();
Expand Down
13 changes: 8 additions & 5 deletions rust/src/datatypes.rs
Original file line number Diff line number Diff line change
Expand Up @@ -278,11 +278,14 @@ impl Schema {

impl fmt::Display for Schema {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
f.write_str(&self.columns
.iter()
.map(|c| c.to_string())
.collect::<Vec<String>>()
.join(", "))
f.write_str(
&self
.columns
.iter()
.map(|c| c.to_string())
.collect::<Vec<String>>()
.join(", "),
)
}
}

Expand Down