@@ -16,7 +16,7 @@ use futures::stream::poll_fn;
16
16
use futures:: { Async , Poll , Stream } ;
17
17
use graphql_parser:: schema as s;
18
18
use serde:: { Deserialize , Serialize } ;
19
- use std:: borrow:: { Borrow , Cow } ;
19
+ use std:: borrow:: Borrow ;
20
20
use std:: collections:: btree_map:: Entry ;
21
21
use std:: collections:: { BTreeMap , BTreeSet , HashSet } ;
22
22
use std:: fmt:: Display ;
@@ -32,7 +32,7 @@ use crate::data::store::*;
32
32
use crate :: data:: value:: Word ;
33
33
use crate :: data_source:: CausalityRegion ;
34
34
use crate :: schema:: InputSchema ;
35
- use crate :: util:: intern:: { self , Error as InternError } ;
35
+ use crate :: util:: intern;
36
36
use crate :: { constraint_violation, prelude:: * } ;
37
37
38
38
/// The type name of an entity. This is the string that is used in the
@@ -1003,45 +1003,6 @@ impl Display for DeploymentLocator {
1003
1003
// connection checkouts
1004
1004
pub type PoolWaitStats = Arc < RwLock < MovingStats > > ;
1005
1005
1006
- /// A representation of entity operations that can be accumulated.
1007
- #[ derive( Debug , Clone ) ]
1008
- enum EntityOp {
1009
- Remove ,
1010
- Update ( Entity ) ,
1011
- Overwrite ( Entity ) ,
1012
- }
1013
-
1014
- impl EntityOp {
1015
- fn apply_to ( self , entity : & mut Option < Cow < Entity > > ) -> Result < ( ) , InternError > {
1016
- use EntityOp :: * ;
1017
- match ( self , entity) {
1018
- ( Remove , e @ _) => * e = None ,
1019
- ( Overwrite ( new) , e @ _) | ( Update ( new) , e @ None ) => * e = Some ( Cow :: Owned ( new) ) ,
1020
- ( Update ( updates) , Some ( entity) ) => entity. to_mut ( ) . merge_remove_null_fields ( updates) ?,
1021
- }
1022
- Ok ( ( ) )
1023
- }
1024
-
1025
- fn accumulate ( & mut self , next : EntityOp ) {
1026
- use EntityOp :: * ;
1027
- let update = match next {
1028
- // Remove and Overwrite ignore the current value.
1029
- Remove | Overwrite ( _) => {
1030
- * self = next;
1031
- return ;
1032
- }
1033
- Update ( update) => update,
1034
- } ;
1035
-
1036
- // We have an update, apply it.
1037
- match self {
1038
- // This is how `Overwrite` is constructed, by accumulating `Update` onto `Remove`.
1039
- Remove => * self = Overwrite ( update) ,
1040
- Update ( current) | Overwrite ( current) => current. merge ( update) ,
1041
- }
1042
- }
1043
- }
1044
-
1045
1006
/// Determines which columns should be selected in a table.
1046
1007
#[ derive( Clone , Debug , PartialEq , Eq , Hash ) ]
1047
1008
pub enum AttributeNames {
0 commit comments