git.iko.soy/typeable/bloodhound
on master help sign in
Merge pull request #123 from Soostone/zero-replicacount

Support replica count of 0

commit26d4e547dd8f8c72f7af730259288b6555a08741 authorChris Allen <cma@bitemyapp.com> dateFri 8 Jul 2016, 12:42 (10 years ago) parent584ffcf6fe1347
1 file changed+2−2
src/Database/Bloodhound/Client.hs+2−2
src/Database/Bloodhound/Client.hs+2−2
@@ -163,13 +163,13 @@ mkShardCount n
163163 | otherwise = Just (ShardCount n)
164164
165165-- | 'mkReplicaCount' is a straight-forward smart constructor for 'ReplicaCount'
166−-- which rejects 'Int' values below 1 and above 1000.
166+-- which rejects 'Int' values below 0 and above 1000.
167167--
168168-- >>> mkReplicaCount 10
169169-- Just (ReplicaCount 10)
170170mkReplicaCount :: Int -> Maybe ReplicaCount
171171mkReplicaCount n
172− | n < 1 = Nothing
172+ | n < 0 = Nothing
173173 | n > 1000 = Nothing -- ...
174174 | otherwise = Just (ReplicaCount n)
175175