lib: remove redundant check in accountnamep
This commit is contained in:
parent
43aa3d479e
commit
d79e707485
@ -461,14 +461,7 @@ accountnamep :: TextParser m AccountName
|
|||||||
accountnamep = do
|
accountnamep = do
|
||||||
firstPart <- part
|
firstPart <- part
|
||||||
otherParts <- many $ try $ singleSpace *> part
|
otherParts <- many $ try $ singleSpace *> part
|
||||||
let account = T.unwords $ firstPart : otherParts
|
pure $ T.unwords $ firstPart : otherParts
|
||||||
|
|
||||||
let roundTripAccount =
|
|
||||||
accountNameFromComponents $ accountNameComponents account
|
|
||||||
when (account /= roundTripAccount) $ fail $
|
|
||||||
"account name seems ill-formed: " ++ T.unpack account
|
|
||||||
|
|
||||||
pure account
|
|
||||||
where
|
where
|
||||||
part = takeWhile1P Nothing (not . isSpace)
|
part = takeWhile1P Nothing (not . isSpace)
|
||||||
singleSpace = void spacenonewline *> notFollowedBy spacenonewline
|
singleSpace = void spacenonewline *> notFollowedBy spacenonewline
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user