Skip to content

Commit

Permalink
clippy: Fix occurrences of type_complexity lint
Browse files Browse the repository at this point in the history
There are more occurrences of this lint in program.rs and variable.rs
but I couldn't find a good way to get rid of them. So let's keep them.
  • Loading branch information
d-e-s-o authored and ryzhyk committed Sep 18, 2019
1 parent e09d1ff commit b2f4350
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
3 changes: 1 addition & 2 deletions rust/template/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,7 @@
clippy::extra_unused_lifetimes,
clippy::ptr_arg,
clippy::ptr_offset_with_cast,
clippy::redundant_closure,
clippy::type_complexity
clippy::redundant_closure
)]

extern crate differential_dataflow;
Expand Down
8 changes: 5 additions & 3 deletions rust/template/src/server.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,12 @@ use std::fmt;
use std::fmt::{Debug, Formatter};
use std::sync::{Arc, Mutex};

type ObserverBox = Box<dyn Observer<Update<super::Value>, String>>;

pub struct UpdatesSubscription {
/// A pointer to the observer field in the outlet, and sets it to
/// `None` upon unsubscribing.
observer: Arc<Mutex<Option<Box<dyn Observer<Update<super::Value>, String>>>>>,
observer: Arc<Mutex<Option<ObserverBox>>>,
}

impl Subscription for UpdatesSubscription {
Expand All @@ -25,7 +27,7 @@ impl Subscription for UpdatesSubscription {
}

pub struct UpdatesObservable {
observer: Arc<Mutex<Option<Box<dyn Observer<Update<super::Value>, String>>>>>,
observer: Arc<Mutex<Option<ObserverBox>>>,
}

impl Observable<Update<super::Value>, String> for UpdatesObservable {
Expand Down Expand Up @@ -94,7 +96,7 @@ impl DDlogServer {
/// An outlet streams a subset of DDlog tables to an observer.
pub struct Outlet {
tables: HashSet<super::Relations>,
observer: Arc<Mutex<Option<Box<dyn Observer<Update<super::Value>, String>>>>>,
observer: Arc<Mutex<Option<ObserverBox>>>,
}

/// Newtype for interior mutability of the observer.
Expand Down

0 comments on commit b2f4350

Please sign in to comment.