Skip to content

Commit 2601a53

Browse files
author
John Christopher McAlpine
committed
purge unnecessary dune libs and unnecessary warning corrections
1 parent 4376b77 commit 2601a53

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

51 files changed

+363
-394
lines changed

src/lib/client/common/dune

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,8 @@
44
(public_name eliom.client.common)
55
(libraries
66
eliom.common
7-
js_of_ocaml
87
js_of_ocaml.tyxml
98
js_of_ocaml-lwt.logger
10-
ocsigenserver
119
react
1210
reactiveData)
1311
(preprocess

src/lib/client/common/eliom_content_core.ml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ module Xml = struct
7272
Lazy.force elt.elt
7373
in
7474
{ node_id = id; elt = Lazy.from_fun f }
75-
let force_lazy { elt; _ } = ignore (Lazy.force elt)
75+
let force_lazy { elt } = ignore (Lazy.force elt)
7676

7777
let make_react ?(id = NoId) signal =
7878
{elt = Lazy.from_val (ReactNode signal); node_id = id; }

src/lib/client/common/eliom_lib.ml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -67,9 +67,9 @@ module Url = struct
6767
String.concat "/" l
6868

6969
let path_of_url = function
70-
| Url.Http {Url.hu_path = path; _}
71-
| Url.Https {Url.hu_path = path; _}
72-
| Url.File {Url.fu_path = path; _} ->
70+
| Url.Http {Url.hu_path = path}
71+
| Url.Https {Url.hu_path = path}
72+
| Url.File {Url.fu_path = path} ->
7373
path
7474

7575
let path_of_url_string s =
@@ -148,8 +148,8 @@ end
148148
(* We do not use the deriving (un)marshaling even if typ is available
149149
because direct jsn (un)marshaling is very fast client side
150150
*)
151-
let to_json ?typ:_ s = Js.to_string (Json.output s)
152-
let of_json ?typ:_ v = Json.unsafe_input (Js.string v)
151+
let to_json ?typ s = Js.to_string (Json.output s)
152+
let of_json ?typ v = Json.unsafe_input (Js.string v)
153153

154154
(* to marshal data and put it in a form *)
155155
let encode_form_value x = to_json x
@@ -166,5 +166,5 @@ let unmarshal_js var =
166166

167167
type file_info = File.file Js.t
168168

169-
let make_cryptographic_safe_string ?len:_ () =
169+
let make_cryptographic_safe_string ?len () =
170170
failwith "make_cryptographic_safe_string not implemented client-side"

src/lib/client/common/eliom_unwrap.ml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ let map : (Obj.t,Obj.t) weakMap Js.t = jsnew weakMap ()
3434
open Js_of_ocaml
3535
open Eliom_lib
3636

37-
let _section = Lwt_log.Section.make "eliom:unwrap"
37+
let section = Lwt_log.Section.make "eliom:unwrap"
3838

3939
module Mark : sig
4040
type t

src/lib/client/dune

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -5,22 +5,9 @@
55
(libraries
66
eliom.common
77
eliom.client.common
8-
ipaddr
98
lwt
10-
js_of_ocaml
119
js_of_ocaml-lwt
12-
js_of_ocaml-lwt.logger
13-
js_of_ocaml.tyxml
14-
lwt_log
15-
lwt_log.core
16-
lwt_react
17-
netstring-pcre
18-
ocsigenserver
19-
ocsigenserver.cookies
20-
ocsigenserver.ext
21-
react
22-
reactiveData
23-
tyxml)
10+
lwt_react)
2411
(preprocess
2512
(pps
2613
js_of_ocaml-ppx

src/lib/client/eliom_bus.ml

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,6 @@ let consume (t,u) s =
4646
| Lwt.Sleep -> Lwt.wakeup_exn u e;
4747
| _ -> ());
4848
[%lwt raise ( e)]
49-
[@ocaml.warning "-22"]
5049
in
5150
Lwt.choose [Lwt.bind t (fun _ -> Lwt.return_unit);t']
5251

@@ -58,8 +57,7 @@ let clone_exn (t,u) s =
5857
(match Lwt.state t with
5958
| Lwt.Sleep -> Lwt.wakeup_exn u e;
6059
| _ -> ());
61-
[%lwt raise ( e)]
62-
[@ocaml.warning "-22"])
60+
[%lwt raise ( e)])
6361

6462
type ('a, 'att, 'co, 'ext, 'reg) callable_bus_service =
6563
(unit, 'a list, Eliom_service.post,
@@ -80,7 +78,7 @@ let create service channel waiter =
8078
in
8179
let error_h =
8280
let t,u = Lwt.wait () in
83-
(try%lwt let%lwt _ = t in assert false with e -> [%lwt raise ( e)][@ocaml.warning "-22"]), u in
81+
(try%lwt let%lwt _ = t in assert false with e -> [%lwt raise ( e)]), u in
8482
let stream =
8583
lazy (
8684
let stream = Eliom_comet.register channel in
@@ -110,7 +108,7 @@ let create service channel waiter =
110108
in
111109
t
112110

113-
let internal_unwrap ((wrapped_bus:('a, 'b) Ecb.wrapped_bus),_unwrapper) =
111+
let internal_unwrap ((wrapped_bus:('a, 'b) Ecb.wrapped_bus),unwrapper) =
114112
let waiter () = Lwt_js.sleep 0.05 in
115113
let channel, Eliom_comet_base.Bus_send_service service = wrapped_bus in
116114
create service channel waiter
@@ -143,7 +141,7 @@ let write t v =
143141
Queue.add v t.queue;
144142
try_flush t
145143

146-
let close {channel; _} = Eliom_comet.close channel
144+
let close {channel} = Eliom_comet.close channel
147145

148146
let set_queue_size b s =
149147
b.max_size <- s

src/lib/client/eliom_client.ml

Lines changed: 10 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ let get_global_data () =
5959
match
6060
Eliom_unwrap.unwrap (Url.decode (Js.to_string v)) 0
6161
with
62-
| {Eliom_runtime.ecs_data = `Success v; _} ->
62+
| {Eliom_runtime.ecs_data = `Success v} ->
6363
Lwt_log.ign_debug_f "Unwrap __global_data success";
6464
Some v
6565
| _ ->
@@ -153,12 +153,12 @@ let init () =
153153
match
154154
Url.url_of_string (Js.to_string (Js.Unsafe.global##.___eliom_server_))
155155
with
156-
| Some (Http { hu_host; hu_port; hu_path = _; _ }) ->
156+
| Some (Http { hu_host; hu_port; hu_path; _ }) ->
157157
init_client_app
158158
~app_name
159159
~ssl:false ~hostname:hu_host ~port:hu_port ~site_dir
160160
()
161-
| Some (Https { hu_host; hu_port; hu_path = _; _ }) ->
161+
| Some (Https { hu_host; hu_port; hu_path; _ }) ->
162162
init_client_app
163163
~app_name
164164
~ssl:true ~hostname:hu_host ~port:hu_port ~site_dir ()
@@ -196,7 +196,7 @@ let init () =
196196

197197
let onload_handler = ref None in
198198

199-
let onload _ev =
199+
let onload ev =
200200
let js_data = Lazy.force js_data in
201201
Lwt_log.ign_debug ~section "onload (client main)";
202202
begin match !onload_handler with
@@ -361,7 +361,7 @@ let raw_call_service
361361
?progress ?upload_progress ?override_mime_type
362362
uri post_params Eliom_request.string_result in
363363
match content with
364-
| None -> [%lwt raise ( (Eliom_request.Failed_request 204))][@ocaml.warning "-22"]
364+
| None -> [%lwt raise ( (Eliom_request.Failed_request 204))]
365365
| Some content -> Lwt.return (uri, content)
366366

367367
let call_service
@@ -507,13 +507,11 @@ let garbage_collect_cached_doms () =
507507
in
508508
let rec accum_past = function
509509
| Some idx when !size < n ->
510-
begin
511510
try
512511
let dom = HistCache.find idx !history_doms in
513512
add idx dom;
514513
accum_past dom.page.previous_page
515514
with Not_found -> ()
516-
end
517515
| _ -> ()
518516
in
519517
let _, _, future = HistCache.split cur_index !history_doms in
@@ -699,7 +697,8 @@ let set_template_content ~replace ~uri ?fragment =
699697
(match fragment with
700698
| None -> change_url_string ~replace uri
701699
| Some fragment ->
702-
change_url_string ~replace (uri ^ "#" ^ fragment));
700+
change_url_string ~replace (uri ^ "#" ^ fragment)
701+
| _ -> ());
703702
let%lwt () = Lwt_mutex.lock load_mutex in
704703
let%lwt (), request_data = unwrap_caml_content content in
705704
do_request_data request_data;
@@ -783,7 +782,6 @@ let set_content_local ?offset ?fragment new_page =
783782
recover ();
784783
Lwt_log.ign_debug ~section ~exn "set_content_local";
785784
[%lwt raise ( exn)]
786-
[@@ocaml.warning "-22"]
787785

788786
(* Function to be called for server side services: *)
789787
let set_content ~replace ~uri ?offset ?fragment content =
@@ -887,7 +885,6 @@ let set_content ~replace ~uri ?offset ?fragment content =
887885
recover ();
888886
Lwt_log.ign_debug ~section ~exn "set_content";
889887
[%lwt raise ( exn)]
890-
[@@ocaml.warning "-22"]
891888

892889
let ocamlify_params =
893890
List.map
@@ -942,7 +939,7 @@ let make_uri subpath params =
942939
Eliom_uri.make_string_uri_from_components (base, params, None)
943940

944941
let route ~replace ?(keep_url = false)
945-
({ Eliom_route.i_subpath ; i_get_params ; i_post_params; _ } as info) =
942+
({ Eliom_route.i_subpath ; i_get_params ; i_post_params } as info) =
946943
Lwt_log.ign_debug ~section:section_page "Route";
947944
let r = !Eliom_request_info.get_sess_info
948945
and info, i_subpath =
@@ -969,7 +966,7 @@ let perform_reload () =
969966
Lwt_log.ign_debug ~section:section_page "Perform reload";
970967
let uri = !current_uri in
971968
let
972-
({ Eliom_common.si_all_get_params ; si_all_post_params = _; _ }
969+
({ Eliom_common.si_all_get_params ; si_all_post_params }
973970
as i_sess_info) =
974971
!Eliom_request_info.get_sess_info ()
975972
and i_subpath = Url.path_of_url_string uri in
@@ -1114,7 +1111,7 @@ type _ redirection =
11141111
'a redirection
11151112

11161113
let change_page_unknown
1117-
?meth ?hostname:_ ?(replace = false) i_subpath i_get_params i_post_params =
1114+
?meth ?hostname ?(replace = false) i_subpath i_get_params i_post_params =
11181115
Lwt_log.ign_debug ~section:section_page "Change page unknown";
11191116
let i_sess_info = !Eliom_request_info.get_sess_info ()
11201117
and i_meth =

src/lib/client/eliom_client_core.ml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,7 @@ end = struct
193193
Lwt_log.raise_error_f "Did not find injection %s" name))
194194

195195
let initialize ~compilation_unit_id
196-
{ Eliom_runtime.injection_id; injection_value; _ } =
196+
{ Eliom_runtime.injection_id; injection_value } =
197197
Lwt_log.ign_debug_f ~section "Initialize injection %d" injection_id;
198198
(* BBB One should assert that injection_value doesn't contain any
199199
value marked for late unwrapping. How to do this efficiently? *)
@@ -269,7 +269,7 @@ let check_global_data global_data =
269269
"Code generating the following client values is not linked on the client:\n%s"
270270
(String.concat "\n"
271271
(List.rev_map
272-
(fun {Eliom_runtime.closure_id; value; _} ->
272+
(fun {Eliom_runtime.closure_id; value} ->
273273
let instance_id =
274274
Eliom_runtime.Client_value_server_repr.instance_id value
275275
in
@@ -404,14 +404,14 @@ let in_onload, broadcast_load_end, wait_load_end, set_loading_phase =
404404
(* forward declaration... *)
405405
let change_page_uri_
406406
: (?cookies_info:bool * string list -> ?tmpl:string -> string -> unit) ref
407-
= ref (fun ?cookies_info:_ ?tmpl:_ _href -> assert false)
407+
= ref (fun ?cookies_info ?tmpl href -> assert false)
408408
let change_page_get_form_
409409
: (?cookies_info:bool * string list ->
410410
?tmpl:string -> Dom_html.formElement Js.t -> string -> unit)
411411
ref
412-
= ref (fun ?cookies_info:_ ?tmpl:_ _form _href -> assert false)
412+
= ref (fun ?cookies_info ?tmpl form href -> assert false)
413413
let change_page_post_form_ =
414-
ref (fun ?cookies_info:_ ?tmpl:_ _form _href -> assert false)
414+
ref (fun ?cookies_info ?tmpl form href -> assert false)
415415

416416
type client_form_handler = Dom_html.event Js.t -> bool Lwt.t
417417

@@ -540,7 +540,7 @@ let rebuild_attrib_val = function
540540
let class_list_of_racontent = function
541541
| Xml.AStr s ->
542542
[s]
543-
| Xml.AStrL (_space, l) ->
543+
| Xml.AStrL (space, l) ->
544544
l
545545
| _ ->
546546
failwith "attribute class is not a string"
@@ -861,7 +861,7 @@ let form_handler
861861
(fun () -> Lwt_log.raise_error_f ~section "not a form element")
862862
in
863863
let kind =
864-
if String.lowercase_ascii(Js.to_string form##._method) = "get"
864+
if String.lowercase(Js.to_string form##._method) = "get"
865865
then `Form_get
866866
else `Form_post
867867
and f _ = Lwt.return_false in
@@ -1008,7 +1008,7 @@ let is_attrib_attrib,get_attrib_id =
10081008
attr##.name##(substring (0) n_len) = n_prefix_js),
10091009
(fun attr -> attr##.value##(substring_toEnd v_len))
10101010

1011-
let relink_attrib _root table (node:Dom_html.element Js.t) =
1011+
let relink_attrib root table (node:Dom_html.element Js.t) =
10121012
Lwt_log.ign_debug ~section "Relink attribute";
10131013
let aux attr =
10141014
if is_attrib_attrib attr

src/lib/client/eliom_comet.ml

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -393,14 +393,14 @@ struct
393393

394394
let call_service_after_load_end service p1 p2 =
395395
let%lwt () = Eliom_client.wait_load_end () in
396-
Eliom_client.call_service ~service p1 p2
396+
Eliom_client.call_service service p1 p2
397397

398398
let make_request hd =
399399
match hd.hd_state with
400400
| Stateful_state count -> (Ecb.Stateful (Ecb.Request_data !count))
401401
| Stateless_state map ->
402402
let l = Eliom_lib.String.Table.fold
403-
(fun channel { position; _ } l -> (channel,position)::l) !map []
403+
(fun channel { position } l -> (channel,position)::l) !map []
404404
in
405405
Ecb.Stateless (Array.of_list l)
406406

@@ -414,8 +414,8 @@ struct
414414
| Stateful_state r ->
415415
incr r;
416416
List.iter (function
417-
| ( _chan_id, Ecb.Data _ ) -> ()
418-
| ( _chan_id, Ecb.Closed ) ->
417+
| ( chan_id, Ecb.Data _ ) -> ()
418+
| ( chan_id, Ecb.Closed ) ->
419419
Eliom_lib.Lwt_log.ign_warning ~section
420420
"update_stateful_state: received Closed: should not happen, this is an eliom bug, please report it"
421421
| ( chan_id, Ecb.Full ) ->
@@ -468,7 +468,7 @@ struct
468468
raise (Comet_error ("update_stateless_state on stateful one"))
469469

470470
let call_service
471-
({ hd_activity; hd_service = Ecb.Comet_service srv; _ } as hd) =
471+
({ hd_activity; hd_service = Ecb.Comet_service srv } as hd) =
472472
let%lwt () =
473473
Configuration.sleep_before_next_request
474474
(fun () -> hd_activity.focused)
@@ -554,7 +554,7 @@ struct
554554
update_activity hd;
555555
aux 0
556556

557-
let call_commands {hd_service = Ecb.Comet_service srv; _} command =
557+
let call_commands {hd_service = Ecb.Comet_service srv} command =
558558
ignore
559559
(try%lwt
560560
call_service_after_load_end srv ()
@@ -684,22 +684,22 @@ let get_stateless_hd (service:Ecb.comet_service) : Service_handler.stateless han
684684
| Not_found -> init service Service_handler.stateless stateless_handler_table
685685

686686
let activate () =
687-
let f _ { hd_service_handler; _ } =
687+
let f _ { hd_service_handler } =
688688
Service_handler.activate hd_service_handler in
689689
Hashtbl.iter f stateless_handler_table;
690690
Hashtbl.iter f stateful_handler_table
691691

692692
let restart () =
693-
let f _ { hd_service_handler; _ } = Service_handler.restart hd_service_handler in
693+
let f _ { hd_service_handler } = Service_handler.restart hd_service_handler in
694694
Hashtbl.iter f stateless_handler_table;
695695
Hashtbl.iter f stateful_handler_table
696696

697697
let close = function
698698
| Ecb.Stateful_channel (chan_service,chan_id) ->
699-
let { hd_service_handler; _ } = get_stateful_hd chan_service in
699+
let { hd_service_handler } = get_stateful_hd chan_service in
700700
Service_handler.close hd_service_handler (Ecb.string_of_chan_id chan_id)
701-
| Ecb.Stateless_channel (chan_service,chan_id,_kind) ->
702-
let { hd_service_handler; _ } = get_stateless_hd chan_service in
701+
| Ecb.Stateless_channel (chan_service,chan_id,kind) ->
702+
let { hd_service_handler } = get_stateless_hd chan_service in
703703
Service_handler.close hd_service_handler (Ecb.string_of_chan_id chan_id)
704704

705705
let unmarshal s : 'a = Eliom_unwrap.unwrap (Eliom_lib.Url.decode s) 0
@@ -738,7 +738,7 @@ let check_and_update_position position msg_pos data =
738738
(* stateless channels are registered with a position: when a channel
739739
is registered more than one time, it is possible to receive old
740740
messages: the position is used to filter them out. *)
741-
let register' hd position (_chan_service:Ecb.comet_service) (chan_id:'a Ecb.chan_id) =
741+
let register' hd position (chan_service:Ecb.comet_service) (chan_id:'a Ecb.chan_id) =
742742
let chan_id = Ecb.string_of_chan_id chan_id in
743743
let stream = Lwt_stream.filter_map_s
744744
(function
@@ -786,7 +786,7 @@ let register ?(wake=true) (wrapped_chan:'a Ecb.wrapped_channel) =
786786
| Ecb.Stateless_channel (s,c,kind) ->
787787
register_stateless ~wake s c kind
788788

789-
let internal_unwrap ( wrapped_chan, _unwrapper ) = register wrapped_chan
789+
let internal_unwrap ( wrapped_chan, unwrapper ) = register wrapped_chan
790790

791791
let () = Eliom_unwrap.register_unwrapper Eliom_common.comet_channel_unwrap_id internal_unwrap
792792

0 commit comments

Comments
 (0)