-
Notifications
You must be signed in to change notification settings - Fork 8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
H-2444: Add Turbine from BP incubator #56
Conversation
This pull request sets up GitHub code scanning for this repository. Once the scans have completed and the checks have passed, the analysis results for this pull request branch will appear on this overview. Once you merge this pull request, the 'Security' tab will show more code scanning analysis results (for example, for the default branch). Depending on your configuration and choice of analysis tool, future pull requests will be annotated with code scanning analysis results. For more information about GitHub code scanning, check out the documentation. |
.filter_map(|(k, v)| k.as_str().map(|k| (k.to_owned(), v.into()))) | ||
.collect(); | ||
|
||
Self::from(properties) |
Check failure
Code scanning / clippy
the trait bound turbine::entity::EntityProperties: core::convert::From<hashbrown::HashMap<alloc::string::String, serde_json::Value>> is not satisfied Error
use petgraph::{graph::NodeIndex, Graph}; | ||
use turbine::{ | ||
entity::{Entity, EntityId, LinkData}, | ||
VersionedUrl, VersionedUrlRef, |
Check warning
Code scanning / clippy
unused import: VersionedUrl Warning
|
||
#[derive(Debug, Copy, Clone)] | ||
pub(crate) struct Node<'a> { | ||
id: &'a VersionedUrl, |
Check warning
Code scanning / clippy
fields id and kind are never read Warning
} | ||
|
||
#[derive(Debug, Copy, Clone)] | ||
pub(crate) struct Node<'a> { |
Check warning
Code scanning / clippy
fields id and kind are never read Warning
#[derive(Debug, Copy, Clone)] | ||
pub(crate) struct Node<'a> { | ||
id: &'a VersionedUrl, | ||
kind: NodeKind, |
Check warning
Code scanning / clippy
fields id and kind are never read Warning
&self.links | ||
} | ||
|
||
pub(crate) fn should_skip(&self, url: &VersionedUrl) -> bool { |
Check warning
Code scanning / clippy
unused self argument Warning
pub(crate) fn links(&self) -> &HashSet<VersionedUrl> { | ||
&self.links | ||
} |
Check warning
Code scanning / clippy
this could be a const fn Warning
.as_ref() | ||
.unwrap_or(&location.name.value); | ||
let mut type_name = Ident::new(type_name_raw, Span::call_site()).to_token_stream(); | ||
let owned_type_name = type_name.clone(); |
Check warning
Code scanning / clippy
redundant clone Warning
.unwrap_or(&location.name.value); | ||
let mut type_name = Ident::new(type_name_raw, Span::call_site()).to_token_stream(); | ||
let owned_type_name = type_name.clone(); | ||
let mut anon_type_name = type_name.clone(); |
Check warning
Code scanning / clippy
redundant clone Warning
let body = match self.variant { | ||
Variant::Ref => { | ||
self.state.import.box_ = true; | ||
quote!((#vis Box<[#inner #lifetime]>)) | ||
} | ||
_ => { | ||
self.state.import.vec = true; | ||
quote!((#vis Vec<#inner #lifetime>)) | ||
} | ||
}; |
Check warning
Code scanning / clippy
you seem to be trying to use match for an equality check. Consider using if Warning
Variant::Mut => quote!(TypeMut), | ||
Variant::Owned => panic!("cannot call into_owned on the owned type!"), | ||
}, | ||
ConversionFunction::AsRef => quote!(Type), |
Check warning
Code scanning / clippy
this match arm has an identical body to another arm Warning
let apply = match kind { | ||
PropertyKind::Array => { | ||
quote! { | ||
let serde_json::Value::Array(value) = value else { | ||
return false; | ||
}; | ||
|
||
for value in value { | ||
if !<#type_>::is_valid_value(value) { | ||
return false; | ||
} | ||
} | ||
} | ||
} | ||
_ => quote! { | ||
if !<#type_>::is_valid_value(value) { | ||
return false; | ||
} | ||
}, | ||
}; |
Check warning
Code scanning / clippy
you seem to be trying to use match for destructuring a single pattern. Consider using if let Warning
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! I can take a look at the lint errors either in this PR or a subsequent one.
Ports across @indietyp's work on
turbine
from the blockprotocol/incubator repository.