avoid head
Recent ghc has a deprecation warning on it. This is not an improvement though. I know these cannot fail, but I can't prove it to ghc.
This commit is contained in:
parent
30713ab0d3
commit
c8fcd97626
2 changed files with 5 additions and 3 deletions
|
@ -473,7 +473,8 @@ claimingUrl = claimingUrl' (const True)
|
|||
claimingUrl' :: (Remote -> Bool) -> URLString -> Annex Remote
|
||||
claimingUrl' remotefilter url = do
|
||||
rs <- remoteList
|
||||
let web = Prelude.head $ filter (\r -> uuid r == webUUID) rs
|
||||
let web = fromMaybe (error "internal") $ headMaybe $
|
||||
filter (\r -> uuid r == webUUID) rs
|
||||
fromMaybe web <$> firstM checkclaim (filter remotefilter rs)
|
||||
where
|
||||
checkclaim = maybe (pure False) (`id` url) . claimUrl
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue