Skip to content

Commit

Permalink
Port to Trustfall v0.4.0 APIs. (#119)
Browse files Browse the repository at this point in the history
  • Loading branch information
obi1kenobi committed Apr 5, 2023
1 parent b6f58f9 commit a2b9c42
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 11 deletions.
8 changes: 4 additions & 4 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ readme = "./README.md"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[dependencies]
trustfall = "0.3.4"
trustfall = "0.4.0-beta"
rustdoc-types = "0.19.0"

[dev-dependencies]
Expand Down
12 changes: 6 additions & 6 deletions src/adapter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ use rustdoc_types::{
use trustfall::{
provider::{
resolve_coercion_with, resolve_neighbors_with, resolve_property_with, Adapter,
ContextIterator, ContextOutcomeIterator, EdgeParameters, QueryInfo, Typename,
VertexIterator,
ContextIterator, ContextOutcomeIterator, EdgeParameters, ResolveEdgeInfo, ResolveInfo,
Typename, VertexIterator,
},
FieldValue, Schema,
};
Expand Down Expand Up @@ -522,7 +522,7 @@ impl<'a> Adapter<'a> for RustdocAdapter<'a> {
&mut self,
edge_name: &Arc<str>,
_parameters: &EdgeParameters,
_query_info: &QueryInfo,
_query_info: &ResolveInfo,
) -> VertexIterator<'a, Self::Vertex> {
match edge_name.as_ref() {
"Crate" => Box::new(std::iter::once(Vertex::new_crate(
Expand All @@ -545,7 +545,7 @@ impl<'a> Adapter<'a> for RustdocAdapter<'a> {
contexts: ContextIterator<'a, Self::Vertex>,
type_name: &Arc<str>,
property_name: &Arc<str>,
_query_info: &QueryInfo,
_query_info: &ResolveInfo,
) -> ContextOutcomeIterator<'a, Self::Vertex, FieldValue> {
if property_name.as_ref() == "__typename" {
Box::new(contexts.map(|ctx| match ctx.active_vertex() {
Expand Down Expand Up @@ -635,7 +635,7 @@ impl<'a> Adapter<'a> for RustdocAdapter<'a> {
type_name: &Arc<str>,
edge_name: &Arc<str>,
parameters: &EdgeParameters,
_query_info: &QueryInfo,
_query_info: &ResolveEdgeInfo,
) -> ContextOutcomeIterator<'a, Self::Vertex, VertexIterator<'a, Self::Vertex>> {
match type_name.as_ref() {
"CrateDiff" => match edge_name.as_ref() {
Expand Down Expand Up @@ -1124,7 +1124,7 @@ impl<'a> Adapter<'a> for RustdocAdapter<'a> {
contexts: ContextIterator<'a, Self::Vertex>,
type_name: &Arc<str>,
coerce_to_type: &Arc<str>,
_query_info: &QueryInfo,
_query_info: &ResolveInfo,
) -> ContextOutcomeIterator<'a, Self::Vertex, bool> {
let coerce_to_type = coerce_to_type.clone();
match type_name.as_ref() {
Expand Down

0 comments on commit a2b9c42

Please sign in to comment.