mirror of
https://github.com/typeable/bloodhound.git
synced 2024-12-12 04:44:11 +03:00
Merge pull request #123 from Soostone/zero-replicacount
Support replica count of 0
This commit is contained in:
commit
26d4e547dd
@ -163,13 +163,13 @@ mkShardCount n
|
||||
| otherwise = Just (ShardCount n)
|
||||
|
||||
-- | 'mkReplicaCount' is a straight-forward smart constructor for 'ReplicaCount'
|
||||
-- which rejects 'Int' values below 1 and above 1000.
|
||||
-- which rejects 'Int' values below 0 and above 1000.
|
||||
--
|
||||
-- >>> mkReplicaCount 10
|
||||
-- Just (ReplicaCount 10)
|
||||
mkReplicaCount :: Int -> Maybe ReplicaCount
|
||||
mkReplicaCount n
|
||||
| n < 1 = Nothing
|
||||
| n < 0 = Nothing
|
||||
| n > 1000 = Nothing -- ...
|
||||
| otherwise = Just (ReplicaCount n)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user