Skip to content

Commit 7119fd2

Browse files
authored
Format repository (#9)
1 parent bc3ecc8 commit 7119fd2

File tree

6 files changed

+9
-10
lines changed

6 files changed

+9
-10
lines changed

src/cli.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ use clap::{Parser, Subcommand};
44

55
#[derive(Parser)]
66
#[command(version)]
7-
87
pub struct Cli {
98
#[arg(short, long)]
109
pub config_filepath: Option<PathBuf>,

src/clients/mock_tiled_client.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ impl MockTiledClient {
1717
let file = File::open(&path)?;
1818

1919
Ok(serde_json::from_reader(file)?)
20-
2120
}
2221
}
2322
impl Client for MockTiledClient {

src/clients/tiled_client.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ use serde::de::DeserializeOwned;
44
use crate::clients::{Client, ClientResult};
55
use crate::schemas::tiled_metadata::Metadata;
66

7-
pub struct TiledClient{
7+
pub struct TiledClient {
88
pub address: Url,
99
}
1010

src/config.rs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
use std::path::Path;
21
use std::net::SocketAddr;
2+
use std::path::Path;
33

44
use config::{Config, ConfigError, File};
55
use serde::Deserialize;
@@ -13,9 +13,7 @@ pub struct GlazedConfig {
1313
}
1414
impl GlazedConfig {
1515
pub fn from_file(path: &Path) -> Result<Self, ConfigError> {
16-
let config = Config::builder()
17-
.add_source(File::from(path))
18-
.build()?;
16+
let config = Config::builder().add_source(File::from(path)).build()?;
1917

2018
config.try_deserialize()
2119
}

src/handlers/graphql.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,9 @@ mod tests {
2424
#[tokio::test]
2525
async fn test_api_version_query() {
2626
let schema = Schema::build(
27-
TiledQuery(MockTiledClient{dir_path: "./resources".into()}),
27+
TiledQuery(MockTiledClient {
28+
dir_path: "./resources".into(),
29+
}),
2830
EmptyMutation,
2931
EmptySubscription,
3032
)

src/main.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,12 @@ mod config;
1010
mod handlers;
1111
mod schemas;
1212

13+
use cli::{Cli, Commands};
14+
1315
use crate::clients::tiled_client::TiledClient;
1416
use crate::config::GlazedConfig;
1517
use crate::handlers::graphql::graphql_handler;
1618
use crate::schemas::TiledQuery;
17-
use cli::{Cli, Commands};
1819

1920
#[tokio::main]
2021
async fn main() -> Result<(), Box<dyn error::Error>> {
@@ -35,7 +36,7 @@ async fn serve(config: GlazedConfig) -> Result<(), Box<dyn error::Error>> {
3536
address: config.tiled_client.address.to_owned(),
3637
}),
3738
EmptyMutation,
38-
EmptySubscription
39+
EmptySubscription,
3940
)
4041
.finish();
4142

0 commit comments

Comments
 (0)