1
1
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:
Artyom 2017-07-10 01:01:05 +03:00
parent ba8b772b22
commit 2998f9def8
No known key found for this signature in database
GPG Key ID: B8E35A33FF522710

View File

@ -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
----------------------------------------------------------------------------