Skip to content

Commit

Permalink
chore: Clippy lints / github settings
Browse files Browse the repository at this point in the history
Remove legacy CI, made clippy happy with automatic fixes

Signed-off-by: Ryan <[email protected]>
  • Loading branch information
ryan-s-roberts committed Apr 18, 2024
1 parent ee4b6f9 commit b6be4f7
Show file tree
Hide file tree
Showing 8 changed files with 15 additions and 22 deletions.
19 changes: 8 additions & 11 deletions .github/settings.yml
Original file line number Diff line number Diff line change
Expand Up @@ -124,11 +124,8 @@ branches:
# this branch
contexts:
- DCO
- pre-commit
- Commit Message Lint
- License Compliance
- cargo-checkmate
- continuous-integration/jenkins/pr-head
# Required. Enforce all configured restrictions for administrators. Set
# to true to enforce required status checks for repository administrators.
# Set to null to disable.
Expand All @@ -143,11 +140,11 @@ branches:
restrictions:

autolinks:
- key_prefix: 'SXT-'
url_template: 'https://blockchaintp.atlassian.net/browse/SXT-<num>'
- key_prefix: 'BCP-'
url_template: 'https://blockchaintp.atlassian.net/browse/BCP-<num>'
- key_prefix: 'CHRON-'
url_template: 'https://blockchaintp.atlassian.net/browse/CHRON-<num>'
- key_prefix: 'DCP-'
url_template: 'https://blockchaintp.atlassian.net/browse/DCP-<num>'
- key_prefix: "SXT-"
url_template: "https://blockchaintp.atlassian.net/browse/SXT-<num>"
- key_prefix: "BCP-"
url_template: "https://blockchaintp.atlassian.net/browse/BCP-<num>"
- key_prefix: "CHRON-"
url_template: "https://blockchaintp.atlassian.net/browse/CHRON-<num>"
- key_prefix: "DCP-"
url_template: "https://blockchaintp.atlassian.net/browse/DCP-<num>"
2 changes: 1 addition & 1 deletion crates/api/src/chronicle_graphql/cursor_query.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ where
T: OutputType,
I: IntoIterator<Item = (T, i64)>,
{
let rx = Vec::from_iter(rx.into_iter());
let rx = Vec::from_iter(rx);
let mut gql = async_graphql::connection::Connection::new(
rx.first().map(|(_, _total)| start > 0).unwrap_or(false),
rx.first()
Expand Down
2 changes: 1 addition & 1 deletion crates/api/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,7 @@ where
pool.get()?
.build_transaction()
.run(|connection| connection.run_pending_migrations(MIGRATIONS).map(|_| ()))
.map_err(|migration| StoreError::DbMigration(migration))?;
.map_err(StoreError::DbMigration)?;

// Append namespace bindings and system namespace
store.namespace_binding(
Expand Down
2 changes: 0 additions & 2 deletions crates/api/src/persistence/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1176,7 +1176,6 @@ impl Store {
.select(schema::entity::external_id)
.load::<String>(connection)?
{
let used = used;
model.used(namespaceid.clone(), &id, &EntityId::from_external_id(used));
}

Expand All @@ -1189,7 +1188,6 @@ impl Store {
.select(schema::activity::external_id)
.load::<String>(connection)?
{
let wasinformedby = wasinformedby;
model.was_informed_by(
namespaceid.clone(),
&id,
Expand Down
1 change: 0 additions & 1 deletion crates/async-sawtooth-sdk/src/ledger.rs
Original file line number Diff line number Diff line change
Expand Up @@ -493,7 +493,6 @@ impl<
}

let channel = self.channel.clone();
let from_block = from_block;
let event_stream = channel.recv_stream::<EventList>().await?;
let event_stream = event_stream.then(move |events| {
let event_type = event_type.clone();
Expand Down
3 changes: 1 addition & 2 deletions crates/chronicle-protocol/src/protocol.rs
Original file line number Diff line number Diff line change
Expand Up @@ -159,8 +159,7 @@ impl messages::Event {

/// `Submission` protocol buffer serializer
pub fn serialize_submission(submission: &messages::Submission) -> Vec<u8> {
let mut buf = Vec::new();
buf.reserve(submission.encoded_len());
let mut buf = Vec::with_capacity(submission.encoded_len());
submission.encode(&mut buf).unwrap();
buf
}
Expand Down
2 changes: 1 addition & 1 deletion crates/common/src/prov/model/from_json_ld.rs
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@ impl ProvModel {
map.get(Chronicle::Value.as_iri().as_str())
{
if array.len() == 1 {
let o = array.get(0).unwrap();
let o = array.first().unwrap();
let serde_object = &o["@value"];

if let serde_json::Value::Object(object) = serde_object {
Expand Down
6 changes: 3 additions & 3 deletions crates/common/src/prov/model/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -484,7 +484,7 @@ impl ProvModel {
) {
self.derivation
.entry((namespace_id, id.clone()))
.or_insert_with(BTreeSet::new)
.or_default()
.insert(Derivation {
typ,
generated_id: id,
Expand Down Expand Up @@ -517,11 +517,11 @@ impl ProvModel {
};
self.delegation
.entry((namespace_id.clone(), responsible_id.clone()))
.or_insert_with(BTreeSet::new)
.or_default()
.insert(delegation.clone());
self.acted_on_behalf_of
.entry((namespace_id.clone(), delegate_id.clone()))
.or_insert_with(BTreeSet::new)
.or_default()
.insert(delegation);
}

Expand Down

0 comments on commit b6be4f7

Please sign in to comment.