Clean some code.
This commit is contained in:
parent
ac5cafeb21
commit
0046f46bbd
|
@ -25,11 +25,9 @@ let remove_spaces str =
|
|||
let evaluate str =
|
||||
match str with
|
||||
| str when is_url str ->
|
||||
begin
|
||||
let title = SimpleHttp.get_http_title (SimpleHttp.get_body str) |> remove_spaces in
|
||||
match title with
|
||||
| Some t -> Some ("[ " ^ t ^ " ]")
|
||||
| None -> None
|
||||
end
|
||||
(let title = SimpleHttp.get_http_title (SimpleHttp.get_body str) |> remove_spaces in
|
||||
match title with
|
||||
| Some t -> Some ("[ " ^ t ^ " ]")
|
||||
| None -> None)
|
||||
| "o/" -> Some "o/"
|
||||
| _ -> None
|
||||
|
|
|
@ -22,8 +22,8 @@ let test_remove_spaces test_ctxt =
|
|||
foo bar baz
|
||||
|
||||
" in
|
||||
let cleaned_str = Evaluate.remove_spaces str in
|
||||
assert_equal "foo bar baz" cleaned_str
|
||||
let cleaned_str = Evaluate.remove_spaces (Some str) in
|
||||
assert_equal (Some "foo bar baz") cleaned_str
|
||||
|
||||
|
||||
(* Name the test cases and group them together *)
|
||||
|
|
Loading…
Reference in a new issue