diff --git a/juniper/CHANGELOG.md b/juniper/CHANGELOG.md index 490fe4449..4dc03f95d 100644 --- a/juniper/CHANGELOG.md +++ b/juniper/CHANGELOG.md @@ -53,7 +53,7 @@ All user visible changes to `juniper` crate will be documented in this file. Thi - Removed lifetime parameter from `ParseError`, `GraphlQLError`, `GraphQLBatchRequest` and `GraphQLRequest`. ([#1081], [#528]) - Upgraded [GraphiQL] to 3.0.9 version (requires new [`graphql-transport-ws` GraphQL over WebSocket Protocol] integration on server, see `juniper_warp/examples/subscription.rs`). ([#1188], [#1193], [#1204]) - Made `LookAheadMethods::children()` method to return slice instead of `Vec`. ([#1200]) -- Abstracted `Spanning::start` and `Spanning::end` fields into separate struct `Span`. ([#1207]) +- Abstracted `Spanning::start` and `Spanning::end` fields into separate struct `Span`. ([#1207], [#1208]) ### Added @@ -133,6 +133,7 @@ All user visible changes to `juniper` crate will be documented in this file. Thi [#1200]: /../../pull/1200 [#1204]: /../../pull/1204 [#1207]: /../../pull/1207 +[#1208]: /../../pull/1208 [ba1ed85b]: /../../commit/ba1ed85b3c3dd77fbae7baf6bc4e693321a94083 [CVE-2022-31173]: /../../security/advisories/GHSA-4rx6-g5vg-5f3j diff --git a/juniper/src/parser/utils.rs b/juniper/src/parser/utils.rs index 6a42f86cb..3ff0318d5 100644 --- a/juniper/src/parser/utils.rs +++ b/juniper/src/parser/utils.rs @@ -50,19 +50,19 @@ impl Span { } } -/// Data structure used to wrap items with start and end markers in the input source -#[derive(Debug, Clone, PartialEq, Eq, Hash, Copy)] +/// Data structure used to wrap items into a [`Span`]. +#[derive(Clone, Copy, Debug, Eq, Hash, PartialEq)] pub struct Spanning { - /// The wrapped item + /// Wrapped item. pub item: T, - /// The span + /// [`Span`] of the wrapped item. pub span: Span, } impl Spanning { #[doc(hidden)] - pub fn new(span: Span, item: T) -> Spanning { + pub fn new(span: Span, item: T) -> Self { Self { item, span } }