Skip to content

Commit 3afd141

Browse files
committed
impl (de)serialize for Zeroable and update CI
1 parent ab21366 commit 3afd141

File tree

5 files changed

+16
-13
lines changed

5 files changed

+16
-13
lines changed

azure-pipelines.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,19 +14,19 @@ jobs:
1414
endpoint: alecmocatta
1515
default:
1616
rust_toolchain: nightly
17-
rust_lint_toolchain: nightly-2019-07-19
17+
rust_lint_toolchain: nightly-2020-06-09
1818
rust_flags: ''
1919
rust_features: ''
2020
rust_target_check: ''
2121
rust_target_build: ''
2222
rust_target_run: ''
2323
matrix:
2424
windows:
25-
imageName: 'vs2017-win2016'
25+
imageName: 'windows-latest'
2626
rust_target_run: 'x86_64-pc-windows-msvc i686-pc-windows-msvc' # currently broken building crate-type=lib: x86_64-pc-windows-gnu i686-pc-windows-gnu
2727
mac:
28-
imageName: 'macos-10.13'
28+
imageName: 'macos-latest'
2929
rust_target_run: 'x86_64-apple-darwin i686-apple-darwin'
3030
linux:
31-
imageName: 'ubuntu-16.04'
31+
imageName: 'ubuntu-latest'
3232
rust_target_run: 'x86_64-unknown-linux-gnu i686-unknown-linux-gnu x86_64-unknown-linux-musl i686-unknown-linux-musl'

src/distinct.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ use std::{
5454
use twox_hash::XxHash;
5555

5656
mod consts;
57-
use self::consts::*;
57+
use self::consts::{BIAS_DATA, RAW_ESTIMATE_DATA, TRESHOLD_DATA};
5858

5959
/// Like [`HyperLogLog`] but implements `Ord` and `Eq` by using the estimate of the cardinality.
6060
#[derive(Serialize, Deserialize)]
@@ -429,7 +429,7 @@ impl<V: ?Sized> IntersectPlusUnionIsPlus for HyperLogLog<V> {
429429

430430
#[cfg(target_feature = "avx512bw")] // TODO
431431
mod simd_types {
432-
use super::*;
432+
use super::packed_simd;
433433
pub type u8s = packed_simd::u8x64;
434434
pub type u8s_sad_out = packed_simd::u64x8;
435435
pub type f32s = packed_simd::f32x16;
@@ -439,7 +439,7 @@ mod simd_types {
439439
#[cfg(target_feature = "avx2")]
440440
mod simd_types {
441441
#![allow(non_camel_case_types)]
442-
use super::*;
442+
use super::packed_simd;
443443
pub type u8s = packed_simd::u8x32;
444444
pub type u8s_sad_out = packed_simd::u64x4;
445445
pub type f32s = packed_simd::f32x8;
@@ -449,7 +449,7 @@ mod simd_types {
449449
#[cfg(all(not(target_feature = "avx2"), target_feature = "sse2"))]
450450
mod simd_types {
451451
#![allow(non_camel_case_types)]
452-
use super::*;
452+
use super::packed_simd;
453453
pub type u8s = packed_simd::u8x16;
454454
pub type u8s_sad_out = packed_simd::u64x2;
455455
pub type f32s = packed_simd::f32x4;
@@ -459,14 +459,14 @@ mod simd_types {
459459
#[cfg(all(not(target_feature = "avx2"), not(target_feature = "sse2")))]
460460
mod simd_types {
461461
#![allow(non_camel_case_types)]
462-
use super::*;
462+
use super::packed_simd;
463463
pub type u8s = packed_simd::u8x8;
464464
pub type u8s_sad_out = u64;
465465
pub type f32s = packed_simd::f32x2;
466466
pub type u32s = packed_simd::u32x2;
467467
pub type u8sq = packed_simd::u8x2;
468468
}
469-
use self::simd_types::*;
469+
use self::simd_types::{f32s, u32s, u8s, u8s_sad_out, u8sq};
470470

471471
struct Sad<X>(PhantomData<fn(X)>);
472472
#[cfg(any(target_arch = "x86", target_arch = "x86_64"))]

src/lib.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,10 @@
4444
clippy::op_ref,
4545
clippy::needless_pass_by_value,
4646
clippy::suspicious_op_assign_impl,
47-
clippy::float_cmp
47+
clippy::float_cmp,
48+
clippy::unsafe_derive_deserialize,
49+
clippy::must_use_candidate,
50+
clippy::unused_self
4851
)]
4952

5053
mod count_min;

src/sample.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,6 @@ impl<T> ops::AddAssign for SampleUnstable<T> {
220220
#[cfg(test)]
221221
mod test {
222222
use super::*;
223-
use rand;
224223
use std::collections::HashMap;
225224

226225
#[test]

src/top.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,13 +153,14 @@ impl<'a, A: Hash + Eq + Clone + Debug, C: Ord + Debug + 'a> Debug for TopIter<'a
153153
}
154154

155155
/// For the result of a `std::iter::sum()` when an additive identity (i.e. zero) can't be constructed (in the case where we're summing an empty iterator).
156-
#[derive(Copy, Clone, Debug)]
156+
#[derive(Copy, Clone, Serialize, Deserialize, Debug)]
157157
pub enum Zeroable<T> {
158158
/// Zero
159159
Zero,
160160
/// Nonzero
161161
Nonzero(T),
162162
}
163+
#[allow(clippy::missing_errors_doc)]
163164
impl<T> Zeroable<T> {
164165
/// Transform to a `Result<T, E>`.
165166
pub fn ok_or<E>(self, err: E) -> Result<T, E> {

0 commit comments

Comments
 (0)