From 0046f46bbd328ae1060a3c0c2c500488c1550518 Mon Sep 17 00:00:00 2001 From: Fabien Freling Date: Sun, 21 Dec 2014 17:00:07 +0100 Subject: [PATCH] Clean some code. --- ocaml/evaluate.ml | 10 ++++------ ocaml/test.ml | 4 ++-- 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/ocaml/evaluate.ml b/ocaml/evaluate.ml index 4625735..b9e64a4 100644 --- a/ocaml/evaluate.ml +++ b/ocaml/evaluate.ml @@ -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 diff --git a/ocaml/test.ml b/ocaml/test.ml index 91ffef3..4ec4b66 100644 --- a/ocaml/test.ml +++ b/ocaml/test.ml @@ -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 *)