mirror of
https://github.com/aelve/guide.git
synced 2024-11-23 04:07:14 +03:00
Don't use 'fromJust' in 'toReferrerView'
There's no reason not to keep on the safer side here
This commit is contained in:
parent
ba8b772b22
commit
2998f9def8
@ -288,13 +288,13 @@ extractKeyword url
|
||||
|
||||
toReferrerView :: Url -> ReferrerView
|
||||
toReferrerView url
|
||||
= case toSearchEngine domain of
|
||||
= case toSearchEngine =<< domain of
|
||||
Just se -> RefSearchEngine se keyword
|
||||
Nothing -> RefUrl url
|
||||
where
|
||||
uri = URI.parseURI $ T.toString url
|
||||
uriAuth = fromJust $ uri >>= URI.uriAuthority
|
||||
domain = T.toStrict $ URI.uriRegName uriAuth
|
||||
uriAuth = URI.uriAuthority =<< uri
|
||||
domain = T.toStrict . URI.uriRegName <$> uriAuth
|
||||
keyword = extractKeyword url
|
||||
|
||||
----------------------------------------------------------------------------
|
||||
|
Loading…
Reference in New Issue
Block a user