Skip to content

Commit b07e8fd

Browse files
committed
f - Use consistent cases when naming structs
1 parent 91691a8 commit b07e8fd

File tree

2 files changed

+12
-12
lines changed

2 files changed

+12
-12
lines changed

lightning-block-sync/src/rest.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,12 @@ use std::convert::TryFrom;
44
use std::convert::TryInto;
55

66
/// A simple REST client for requesting resources using HTTP `GET`.
7-
pub struct RESTClient {
7+
pub struct RestClient {
88
endpoint: HttpEndpoint,
99
client: HttpClient,
1010
}
1111

12-
impl RESTClient {
12+
impl RestClient {
1313
pub fn new(endpoint: HttpEndpoint) -> std::io::Result<Self> {
1414
let client = HttpClient::connect(&endpoint)?;
1515
Ok(Self { endpoint, client })
@@ -48,7 +48,7 @@ mod tests {
4848
#[tokio::test]
4949
async fn request_unknown_resource() {
5050
let server = HttpServer::responding_with_not_found();
51-
let mut client = RESTClient::new(server.endpoint()).unwrap();
51+
let mut client = RestClient::new(server.endpoint()).unwrap();
5252

5353
match client.request_resource::<BinaryResponse, u32>("/").await {
5454
Err(e) => assert_eq!(e.kind(), std::io::ErrorKind::NotFound),
@@ -59,7 +59,7 @@ mod tests {
5959
#[tokio::test]
6060
async fn request_malformed_resource() {
6161
let server = HttpServer::responding_with_ok(MessageBody::Content("foo"));
62-
let mut client = RESTClient::new(server.endpoint()).unwrap();
62+
let mut client = RestClient::new(server.endpoint()).unwrap();
6363

6464
match client.request_resource::<BinaryResponse, u32>("/").await {
6565
Err(e) => assert_eq!(e.kind(), std::io::ErrorKind::InvalidData),
@@ -70,7 +70,7 @@ mod tests {
7070
#[tokio::test]
7171
async fn request_valid_resource() {
7272
let server = HttpServer::responding_with_ok(MessageBody::Content(42));
73-
let mut client = RESTClient::new(server.endpoint()).unwrap();
73+
let mut client = RestClient::new(server.endpoint()).unwrap();
7474

7575
match client.request_resource::<BinaryResponse, u32>("/").await {
7676
Err(e) => panic!("Unexpected error: {:?}", e),

lightning-block-sync/src/rpc.rs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,14 @@ use std::convert::TryInto;
88
use std::sync::atomic::{AtomicUsize, Ordering};
99

1010
/// A simple RPC client for calling methods using HTTP `POST`.
11-
pub struct RPCClient {
11+
pub struct RpcClient {
1212
basic_auth: String,
1313
endpoint: HttpEndpoint,
1414
client: HttpClient,
1515
id: AtomicUsize,
1616
}
1717

18-
impl RPCClient {
18+
impl RpcClient {
1919
pub fn new(user_auth: &str, endpoint: HttpEndpoint) -> std::io::Result<Self> {
2020
let client = HttpClient::connect(&endpoint)?;
2121
Ok(Self {
@@ -79,7 +79,7 @@ mod tests {
7979
#[tokio::test]
8080
async fn call_method_returning_unknown_response() {
8181
let server = HttpServer::responding_with_not_found();
82-
let mut client = RPCClient::new("credentials", server.endpoint()).unwrap();
82+
let mut client = RpcClient::new("credentials", server.endpoint()).unwrap();
8383

8484
match client.call_method::<u64>("getblockcount", &[]).await {
8585
Err(e) => assert_eq!(e.kind(), std::io::ErrorKind::NotFound),
@@ -91,7 +91,7 @@ mod tests {
9191
async fn call_method_returning_malfomred_response() {
9292
let response = serde_json::json!("foo");
9393
let server = HttpServer::responding_with_ok(MessageBody::Content(response));
94-
let mut client = RPCClient::new("credentials", server.endpoint()).unwrap();
94+
let mut client = RpcClient::new("credentials", server.endpoint()).unwrap();
9595

9696
match client.call_method::<u64>("getblockcount", &[]).await {
9797
Err(e) => {
@@ -108,7 +108,7 @@ mod tests {
108108
"error": { "code": -8, "message": "invalid parameter" },
109109
});
110110
let server = HttpServer::responding_with_ok(MessageBody::Content(response));
111-
let mut client = RPCClient::new("credentials", server.endpoint()).unwrap();
111+
let mut client = RpcClient::new("credentials", server.endpoint()).unwrap();
112112

113113
let invalid_block_hash = serde_json::json!("foo");
114114
match client.call_method::<u64>("getblock", &[invalid_block_hash]).await {
@@ -124,7 +124,7 @@ mod tests {
124124
async fn call_method_returning_missing_result() {
125125
let response = serde_json::json!({ "result": null });
126126
let server = HttpServer::responding_with_ok(MessageBody::Content(response));
127-
let mut client = RPCClient::new("credentials", server.endpoint()).unwrap();
127+
let mut client = RpcClient::new("credentials", server.endpoint()).unwrap();
128128

129129
match client.call_method::<u64>("getblockcount", &[]).await {
130130
Err(e) => {
@@ -139,7 +139,7 @@ mod tests {
139139
async fn call_method_returning_valid_result() {
140140
let response = serde_json::json!({ "result": 654470 });
141141
let server = HttpServer::responding_with_ok(MessageBody::Content(response));
142-
let mut client = RPCClient::new("credentials", server.endpoint()).unwrap();
142+
let mut client = RpcClient::new("credentials", server.endpoint()).unwrap();
143143

144144
match client.call_method::<u64>("getblockcount", &[]).await {
145145
Err(e) => panic!("Unexpected error: {:?}", e),

0 commit comments

Comments
 (0)