Clippy
This commit is contained in:
parent
39bb6110e2
commit
61d1486cd8
|
@ -7,6 +7,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|||
## [3.0.19] 2021-12-28
|
||||
|
||||
- Add `InputType` / `OutputType` support for `hashbrown` crate.
|
||||
- Bump actix-web from `4.0.0-beta.14` to `4.0.0-beta.18`. [#768](https://github.com/async-graphql/async-graphql/pull/768)
|
||||
|
||||
## [3.0.18] 2021-12-26
|
||||
|
||||
|
|
|
@ -79,6 +79,7 @@ This crate offers the following features, all of which are not activated by defa
|
|||
- `decimal`: Integrate with the [`rust_decimal` crate](https://crates.io/crates/rust_decimal).
|
||||
- `cbor`: Support for [serde_cbor](https://crates.io/crates/serde_cbor).
|
||||
- `smol_str`: Integrate with the [`smol_str` crate](https://crates.io/crates/smol_str).
|
||||
- `hashbrown`: Integrate with the [`hashbrown` crate](https://github.com/rust-lang/hashbrown).
|
||||
|
||||
## Apollo Studio
|
||||
|
||||
|
|
|
@ -126,16 +126,13 @@ impl VariableDefinition {
|
|||
/// `Value::Null` if it is nullable and `None` otherwise.
|
||||
#[must_use]
|
||||
pub fn default_value(&self) -> Option<&ConstValue> {
|
||||
self.default_value
|
||||
.as_ref()
|
||||
.map(|value| &value.node)
|
||||
.or_else(|| {
|
||||
if self.var_type.node.nullable {
|
||||
Some(&ConstValue::Null)
|
||||
} else {
|
||||
None
|
||||
}
|
||||
})
|
||||
self.default_value.as_ref().map(|value| &value.node).or({
|
||||
if self.var_type.node.nullable {
|
||||
Some(&ConstValue::Null)
|
||||
} else {
|
||||
None
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -110,6 +110,7 @@ impl ServerError {
|
|||
}
|
||||
|
||||
#[doc(hidden)]
|
||||
#[must_use]
|
||||
pub fn with_path(self, path: Vec<PathSegment>) -> Self {
|
||||
Self { path, ..self }
|
||||
}
|
||||
|
|
|
@ -29,6 +29,7 @@ impl<'a> Lookahead<'a> {
|
|||
///
|
||||
/// For example, calling `.field("a")` on `{ a { b } }` will return a lookahead that
|
||||
/// represents `{ b }`.
|
||||
#[must_use]
|
||||
pub fn field(&self, name: &str) -> Self {
|
||||
let mut fields = Vec::new();
|
||||
for field in &self.fields {
|
||||
|
|
|
@ -59,6 +59,7 @@ impl Request {
|
|||
}
|
||||
|
||||
/// Specify the operation name of the request.
|
||||
#[must_use]
|
||||
pub fn operation_name<T: Into<String>>(self, name: T) -> Self {
|
||||
Self {
|
||||
operation_name: Some(name.into()),
|
||||
|
@ -67,6 +68,7 @@ impl Request {
|
|||
}
|
||||
|
||||
/// Specify the variables.
|
||||
#[must_use]
|
||||
pub fn variables(self, variables: Variables) -> Self {
|
||||
Self { variables, ..self }
|
||||
}
|
||||
|
@ -78,6 +80,7 @@ impl Request {
|
|||
}
|
||||
|
||||
/// Disable introspection queries for this request.
|
||||
#[must_use]
|
||||
pub fn disable_introspection(mut self) -> Self {
|
||||
self.disable_introspection = true;
|
||||
self
|
||||
|
|
Loading…
Reference in New Issue
Block a user