Skip to content

Commit b54610a

Browse files
authored
Merge pull request #289 from mathstuf/ci-fixes
Ci fixes
2 parents c48a3cf + b688646 commit b54610a

File tree

5 files changed

+16
-8
lines changed

5 files changed

+16
-8
lines changed

.travis.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,10 @@ before_script:
2929
- if [ "$GRAPHQL_STYLE" = "true" ]; then (npm i -g prettier) fi
3030
- if [ "$GRAPHQL_STYLE" = "true" ]; then (rustup component add rustfmt clippy) fi
3131
- if [ "$GRAPHQL_WASM" = "true" ]; then (rustup target add wasm32-unknown-unknown) fi
32-
- if [ "$GRAPHQL_WASM" = "true" ]; then (wget https://github.com/rustwasm/wasm-bindgen/releases/download/0.2.51/wasm-bindgen-0.2.51-x86_64-unknown-linux-musl.tar.gz) fi
32+
- if [ "$GRAPHQL_WASM" = "true" ]; then (wget https://github.com/rustwasm/wasm-bindgen/releases/download/0.2.54/wasm-bindgen-0.2.54-x86_64-unknown-linux-musl.tar.gz) fi
3333
- if [ "$GRAPHQL_WASM" = "true" ]; then (mkdir wasm-bindgen) fi
34-
- if [ "$GRAPHQL_WASM" = "true" ]; then (tar -xzf wasm-bindgen-0.2.51-x86_64-unknown-linux-musl.tar.gz -C wasm-bindgen) fi
35-
- export PATH=$PATH:$PWD/wasm-bindgen/wasm-bindgen-0.2.51-x86_64-unknown-linux-musl
34+
- if [ "$GRAPHQL_WASM" = "true" ]; then (tar -xzf wasm-bindgen-0.2.54-x86_64-unknown-linux-musl.tar.gz -C wasm-bindgen) fi
35+
- export PATH=$PATH:$PWD/wasm-bindgen/wasm-bindgen-0.2.54-x86_64-unknown-linux-musl
3636
script:
3737
- if [ "$GRAPHQL_STYLE" = "true" ]; then (cargo fmt --all -- --check) fi
3838
- if [ "$GRAPHQL_STYLE" = "true" ]; then (cargo clippy -- -D warnings) fi

graphql_client/tests/input_object_variables.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,10 @@ fn input_object_variables_default() {
4141

4242
let out = serde_json::to_string(&variables).unwrap();
4343

44-
assert_eq!(out, r#"{"msg":{"content":null,"to":{"category":null,"email":"[email protected]","name":null}}}"#);
44+
assert_eq!(
45+
out,
46+
r#"{"msg":{"content":null,"to":{"category":null,"email":"[email protected]","name":null}}}"#,
47+
);
4548
}
4649

4750
#[derive(GraphQLQuery)]

graphql_client_codegen/src/enums.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ impl<'schema> GqlEnum<'schema> {
6262
let variant_str: Vec<&str> = self.variants.iter().map(|v| v.name).collect();
6363
let variant_str = &variant_str;
6464

65-
let name = name_ident.clone();
65+
let name = name_ident;
6666

6767
quote! {
6868
#derives

graphql_client_codegen/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ pub fn generate_module_token_stream(
104104
hash_map::Entry::Occupied(o) => o.get().clone(),
105105
hash_map::Entry::Vacant(v) => {
106106
let schema_string = read_file(v.key())?;
107-
v.insert(schema_string).to_string()
107+
(*v.insert(schema_string)).to_string()
108108
}
109109
}
110110
};

graphql_client_codegen/src/unions.rs

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,12 @@ pub(crate) fn union_variants<'selection>(
7575
Some(Ok(Some(tokens))) => children_definitions.push(tokens),
7676
Some(Err(err)) => return Err(err),
7777
Some(Ok(None)) => (),
78-
None => return Err(UnionError::UnknownType { ty: on.to_string() }.into()),
78+
None => {
79+
return Err(UnionError::UnknownType {
80+
ty: (*on).to_string(),
81+
}
82+
.into())
83+
}
7984
};
8085

8186
variants.push(quote! {
@@ -113,7 +118,7 @@ impl<'schema> GqlUnion<'schema> {
113118
if !self.variants.contains(used_variant) {
114119
return Err(UnionError::UnknownVariant {
115120
ty: self.name.into(),
116-
var: used_variant.to_string(),
121+
var: (*used_variant).to_string(),
117122
}
118123
.into());
119124
}

0 commit comments

Comments
 (0)