Skip to content

Commit 096fa9e

Browse files
Fix clippies
1 parent 77085c8 commit 096fa9e

File tree

2 files changed

+13
-16
lines changed

2 files changed

+13
-16
lines changed

src/composition/supergraph/config/federation.rs

+5-7
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,8 @@ use std::marker::PhantomData;
66
use apollo_federation_types::config::{FederationVersion, SupergraphConfig};
77
use derive_getters::Getters;
88

9-
use crate::command::supergraph::compose::do_compose::SupergraphComposeOpts;
10-
119
use super::full::FullyResolvedSubgraph;
10+
use crate::command::supergraph::compose::do_compose::SupergraphComposeOpts;
1211

1312
mod state {
1413
#[derive(Clone, Debug)]
@@ -166,9 +165,8 @@ mod tests {
166165
use apollo_federation_types::config::{FederationVersion, SubgraphConfig, SupergraphConfig};
167166
use speculoos::prelude::*;
168167

169-
use crate::composition::supergraph::config::{full::FullyResolvedSubgraph, scenario::*};
170-
171168
use super::FederationVersionResolverFromSupergraphConfig;
169+
use crate::composition::supergraph::config::{full::FullyResolvedSubgraph, scenario::*};
172170

173171
/// Test showing that federation version is selected from the user-specified fed version
174172
/// over local supergraph config or resolved subgraphs
@@ -189,7 +187,7 @@ mod tests {
189187
let supergraph_config =
190188
SupergraphConfig::new(unresolved_subgraphs, Some(FederationVersion::LatestFedOne));
191189

192-
let resolved_subgraphs = vec![(
190+
let resolved_subgraphs = [(
193191
subgraph_name.to_string(),
194192
FullyResolvedSubgraph::builder()
195193
.schema(subgraph_scenario.sdl)
@@ -222,7 +220,7 @@ mod tests {
222220
let supergraph_config =
223221
SupergraphConfig::new(unresolved_subgraphs, Some(FederationVersion::LatestFedTwo));
224222

225-
let resolved_subgraphs = vec![(
223+
let resolved_subgraphs = [(
226224
subgraph_name.to_string(),
227225
FullyResolvedSubgraph::builder()
228226
.schema(subgraph_scenario.sdl)
@@ -254,7 +252,7 @@ mod tests {
254252
let federation_version_resolver = FederationVersionResolverFromSupergraphConfig::default();
255253
let supergraph_config = SupergraphConfig::new(unresolved_subgraphs, None);
256254

257-
let resolved_subgraphs = vec![(
255+
let resolved_subgraphs = [(
258256
subgraph_name.to_string(),
259257
FullyResolvedSubgraph::builder()
260258
.schema(subgraph_scenario.sdl)

src/utils/supergraph_config.rs

+8-9
Original file line numberDiff line numberDiff line change
@@ -487,7 +487,7 @@ mod test_get_supergraph_config {
487487
let supergraph_config_path = third_level_folder.path().join("supergraph.yaml");
488488
fs::write(
489489
supergraph_config_path.clone(),
490-
&supergraph_config.into_bytes(),
490+
supergraph_config.into_bytes(),
491491
)
492492
.expect("Could not write supergraph.yaml");
493493

@@ -568,9 +568,10 @@ fn merge_supergraph_configs(
568568

569569
#[cfg(test)]
570570
mod test_merge_supergraph_configs {
571-
use super::*;
572571
use rstest::{fixture, rstest};
573572

573+
use super::*;
574+
574575
#[fixture]
575576
#[once]
576577
fn local_supergraph_config_with_latest_fed_one_version() -> SupergraphConfig {
@@ -1048,6 +1049,7 @@ mod test_resolve_supergraph_yaml {
10481049
use apollo_federation_types::config::{FederationVersion, SchemaSource, SubgraphConfig};
10491050
use assert_fs::TempDir;
10501051
use camino::Utf8PathBuf;
1052+
use houston::Config;
10511053
use httpmock::MockServer;
10521054
use indoc::indoc;
10531055
use rstest::{fixture, rstest};
@@ -1056,14 +1058,11 @@ mod test_resolve_supergraph_yaml {
10561058
use speculoos::assert_that;
10571059
use speculoos::prelude::{ResultAssertions, VecAssertions};
10581060

1059-
use houston::Config;
1060-
1061+
use super::*;
10611062
use crate::options::ProfileOpt;
10621063
use crate::utils::client::{ClientBuilder, StudioClientConfig};
10631064
use crate::utils::parsers::FileDescriptorType;
10641065

1065-
use super::*;
1066-
10671066
#[fixture]
10681067
fn profile_opt() -> ProfileOpt {
10691068
ProfileOpt {
@@ -1185,7 +1184,7 @@ subgraphs:
11851184
routing_url: https://people.example.com
11861185
schema:
11871186
file: ./people.graphql"#,
1188-
latest_fed2_version.to_string()
1187+
latest_fed2_version
11891188
);
11901189
let tmp_home = TempDir::new().unwrap();
11911190
let mut config_path = Utf8PathBuf::try_from(tmp_home.path().to_path_buf()).unwrap();
@@ -1225,7 +1224,7 @@ subgraphs:
12251224
routing_url: https://people.example.com
12261225
schema:
12271226
file: ../../people.graphql"#,
1228-
latest_fed2_version.to_string()
1227+
latest_fed2_version
12291228
);
12301229
let tmp_home = TempDir::new().unwrap();
12311230
let tmp_dir = Utf8PathBuf::try_from(tmp_home.path().to_path_buf()).unwrap();
@@ -1279,7 +1278,7 @@ subgraphs:
12791278
routing_url: https://people.example.com
12801279
schema:
12811280
file: ../../people.graphql"#,
1282-
latest_fed2_version.to_string()
1281+
latest_fed2_version
12831282
);
12841283
let tmp_home = TempDir::new().unwrap();
12851284
let tmp_dir = Utf8PathBuf::try_from(tmp_home.path().to_path_buf()).unwrap();

0 commit comments

Comments
 (0)