RPC: replace return () with return_unit

This commit is contained in:
Vincent Botbol 2018-10-08 12:01:34 +02:00
parent c631de08f9
commit f4a368f81e
No known key found for this signature in database
GPG Key ID: A2CE1BDBED95DA38
3 changed files with 8 additions and 6 deletions

View File

@ -718,7 +718,7 @@ let build_rpc_directory net =
| None -> RPC_answer.not_found | None -> RPC_answer.not_found
| Some pool -> | Some pool ->
P2p_pool.Peers.forget pool peer_id ; P2p_pool.Peers.forget pool peer_id ;
RPC_answer.return () RPC_answer.return_unit
end in end in
let dir = let dir =
@ -729,7 +729,7 @@ let build_rpc_directory net =
| Some pool -> | Some pool ->
P2p_pool.Peers.unset_trusted pool peer_id; P2p_pool.Peers.unset_trusted pool peer_id;
P2p_pool.Peers.ban pool peer_id ; P2p_pool.Peers.ban pool peer_id ;
RPC_answer.return () RPC_answer.return_unit
end in end in
let dir = let dir =
@ -739,7 +739,7 @@ let build_rpc_directory net =
| None -> RPC_answer.not_found | None -> RPC_answer.not_found
| Some pool -> | Some pool ->
P2p_pool.Peers.set_trusted pool peer_id ; P2p_pool.Peers.set_trusted pool peer_id ;
RPC_answer.return () RPC_answer.return_unit
end in end in
let dir = let dir =
@ -823,7 +823,7 @@ let build_rpc_directory net =
| None -> RPC_answer.not_found | None -> RPC_answer.not_found
| Some pool -> | Some pool ->
P2p_pool.Points.forget pool point ; P2p_pool.Points.forget pool point ;
RPC_answer.return () RPC_answer.return_unit
end in end in
let dir = let dir =
@ -834,7 +834,7 @@ let build_rpc_directory net =
| Some pool -> | Some pool ->
P2p_pool.Points.unset_trusted pool point; P2p_pool.Points.unset_trusted pool point;
P2p_pool.Points.ban pool point; P2p_pool.Points.ban pool point;
RPC_answer.return () RPC_answer.return_unit
end in end in
let dir = let dir =
@ -844,7 +844,7 @@ let build_rpc_directory net =
| None -> RPC_answer.not_found | None -> RPC_answer.not_found
| Some pool -> | Some pool ->
P2p_pool.Points.set_trusted pool point ; P2p_pool.Points.set_trusted pool point ;
RPC_answer.return () RPC_answer.return_unit
end in end in
let dir = let dir =

View File

@ -42,6 +42,7 @@ and 'a stream = 'a Resto_directory.Answer.stream = {
} }
let return x = Lwt.return (`Ok x) let return x = Lwt.return (`Ok x)
let return_unit = Lwt.return (`Ok ())
let return_stream x = Lwt.return (`OkStream x) let return_stream x = Lwt.return (`OkStream x)
let not_found = Lwt.return (`Not_found None) let not_found = Lwt.return (`Not_found None)

View File

@ -42,6 +42,7 @@ and 'a stream = 'a Resto_directory.Answer.stream = {
} }
val return: 'o -> 'o t Lwt.t val return: 'o -> 'o t Lwt.t
val return_unit: unit t Lwt.t
val return_stream: 'o stream -> 'o t Lwt.t val return_stream: 'o stream -> 'o t Lwt.t
val not_found: 'o t Lwt.t val not_found: 'o t Lwt.t