Skip to content
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

Update Rust toolchains to nightly-2024-09-23 #5216

Merged
merged 7 commits into from
Sep 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
3 changes: 1 addition & 2 deletions .rustfmt.toml
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
# General
edition = "2024" # Default: "2015"
style_edition = "2024" # Default: "2015"
unstable_features = true # Default: false
version = "Two" # Default: "One"

# Settings
condense_wildcard_suffixes = true # Default: false
reorder_impl_items = true # Default: false
use_field_init_shorthand = true # Default: false
use_try_shorthand = true # Default: false
Expand Down
4 changes: 2 additions & 2 deletions apps/hash-graph/bins/cli/src/args.rs
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
use clap::{
ColorChoice, CommandFactory, FromArgMatches, Parser,
builder::{
styling::{AnsiColor, Effects},
Styles,
styling::{AnsiColor, Effects},
},
ColorChoice, CommandFactory, FromArgMatches, Parser,
};
use hash_tracing::TracingConfig;

Expand Down
16 changes: 8 additions & 8 deletions apps/hash-graph/bins/cli/src/subcommand/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,18 +8,18 @@ mod type_fetcher;

use core::time::Duration;

use error_stack::{ensure, Result};
use hash_tracing::{init_tracing, TracingConfig};
use error_stack::{Result, ensure};
use hash_tracing::{TracingConfig, init_tracing};
use tokio::{runtime::Handle, time::sleep};

#[cfg(feature = "test-server")]
pub use self::test_server::{test_server, TestServerArgs};
pub use self::test_server::{TestServerArgs, test_server};
pub use self::{
completions::{completions, CompletionsArgs},
migrate::{migrate, MigrateArgs},
server::{server, ServerArgs},
snapshot::{snapshot, SnapshotArgs},
type_fetcher::{type_fetcher, TypeFetcherArgs},
completions::{CompletionsArgs, completions},
migrate::{MigrateArgs, migrate},
server::{ServerArgs, server},
snapshot::{SnapshotArgs, snapshot},
type_fetcher::{TypeFetcherArgs, type_fetcher},
};
use crate::error::{GraphError, HealthcheckError};

Expand Down
4 changes: 2 additions & 2 deletions apps/hash-graph/bins/cli/src/subcommand/server.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ use core::{
};

use authorization::{
AuthorizationApi, NoAuthorization,
backend::{SpiceDbOpenApi, ZanzibarBackend},
zanzibar::ZanzibarClient,
AuthorizationApi, NoAuthorization,
};
use clap::Parser;
use error_stack::{Report, Result, ResultExt};
Expand All @@ -19,7 +19,7 @@ use graph::{
DatabaseConnectionInfo, DatabasePoolConfig, FetchingPool, PostgresStorePool, StorePool,
},
};
use graph_api::rest::{rest_api_router, RestRouterDependencies};
use graph_api::rest::{RestRouterDependencies, rest_api_router};
use regex::Regex;
use reqwest::{Client, Url};
use temporal_client::TemporalClientConfig;
Expand Down
2 changes: 1 addition & 1 deletion apps/hash-graph/bins/cli/src/subcommand/snapshot.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use authorization::{
AuthorizationApi, NoAuthorization,
backend::{SpiceDbOpenApi, ZanzibarBackend},
zanzibar::ZanzibarClient,
AuthorizationApi, NoAuthorization,
};
use clap::Parser;
use error_stack::{Report, ResultExt};
Expand Down
2 changes: 1 addition & 1 deletion apps/hash-graph/bins/cli/src/subcommand/test_server.rs
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
use core::{net::SocketAddr, time::Duration};

use authorization::{
AuthorizationApi,
backend::{SpiceDbOpenApi, ZanzibarBackend},
zanzibar::ZanzibarClient,
AuthorizationApi,
};
use clap::Parser;
use error_stack::{Result, ResultExt};
Expand Down
2 changes: 1 addition & 1 deletion apps/hash-graph/bins/cli/src/subcommand/type_fetcher.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ use core::time::Duration;

use clap::Parser;
use error_stack::{Result, ResultExt};
use futures::{future, StreamExt};
use futures::{StreamExt, future};
use tarpc::{
serde_transport::Transport,
server::{self, Channel},
Expand Down
6 changes: 3 additions & 3 deletions apps/hash-graph/libs/api/src/rest/account.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,20 @@
use alloc::sync::Arc;

use authorization::{
AuthorizationApi, AuthorizationApiPool,
backend::ModifyRelationshipOperation,
schema::{
AccountGroupMemberSubject, AccountGroupPermission, AccountGroupRelationAndSubject,
WebOwnerSubject,
},
zanzibar::Consistency,
AuthorizationApi, AuthorizationApiPool,
};
use axum::{
Extension, Router,
extract::Path,
http::StatusCode,
response::Response,
routing::{get, post},
Extension, Router,
};
use graph::store::StorePool;
use graph_types::{
Expand All @@ -29,7 +29,7 @@ use utoipa::OpenApi;

use super::api_resource::RoutedResource;
use crate::rest::{
json::Json, status::report_to_response, AuthenticatedUserHeader, PermissionResponse,
AuthenticatedUserHeader, PermissionResponse, json::Json, status::report_to_response,
};

#[derive(OpenApi)]
Expand Down
48 changes: 21 additions & 27 deletions apps/hash-graph/libs/api/src/rest/data_type.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,19 @@ use alloc::sync::Arc;
use std::collections::HashMap;

use authorization::{
AuthorizationApi, AuthorizationApiPool,
backend::{ModifyRelationshipOperation, PermissionAssertion},
schema::{
DataTypeOwnerSubject, DataTypePermission, DataTypeRelationAndSubject, DataTypeViewerSubject,
},
zanzibar::Consistency,
AuthorizationApi, AuthorizationApiPool,
};
use axum::{
Extension, Router,
extract::Path,
http::StatusCode,
response::Response,
routing::{get, post, put},
Extension, Router,
};
use error_stack::{Report, ResultExt};
use graph::{
Expand All @@ -25,13 +25,13 @@ use graph::{
patch_id_and_parse,
},
store::{
BaseUrlAlreadyExists, DataTypeStore, OntologyVersionDoesNotExist, StorePool,
error::VersionedUrlAlreadyExists,
ontology::{
ArchiveDataTypeParams, CreateDataTypeParams, GetDataTypeSubgraphParams,
GetDataTypesParams, GetDataTypesResponse, UnarchiveDataTypeParams,
UpdateDataTypeEmbeddingParams, UpdateDataTypesParams,
},
BaseUrlAlreadyExists, DataTypeStore, OntologyVersionDoesNotExist, StorePool,
},
};
use graph_types::{
Expand All @@ -42,7 +42,7 @@ use graph_types::{
},
owned_by_id::OwnedById,
};
use hash_graph_store::{data_type::DataTypeQueryToken, ConflictBehavior};
use hash_graph_store::{ConflictBehavior, data_type::DataTypeQueryToken};
use hash_status::Status;
use serde::{Deserialize, Serialize};
use temporal_client::TemporalClient;
Expand All @@ -58,10 +58,10 @@ use utoipa::{OpenApi, ToSchema};

use super::api_resource::RoutedResource;
use crate::rest::{
AuthenticatedUserHeader, PermissionResponse, RestApiStore,
json::Json,
status::{report_to_response, status_to_response},
utoipa_typedef::{subgraph::Subgraph, ListOrValue, MaybeListOfDataType},
AuthenticatedUserHeader, PermissionResponse, RestApiStore,
utoipa_typedef::{ListOrValue, MaybeListOfDataType, subgraph::Subgraph},
};

#[derive(OpenApi)]
Expand Down Expand Up @@ -372,19 +372,16 @@ where

Ok(Json(
store
.create_data_type(
actor_id,
CreateDataTypeParams {
schema,
classification: OntologyTypeClassificationMetadata::External {
fetched_at: OffsetDateTime::now_utc(),
},
relationships,
conflict_behavior: ConflictBehavior::Fail,
provenance: *provenance,
conversions: conversions.clone(),
.create_data_type(actor_id, CreateDataTypeParams {
schema,
classification: OntologyTypeClassificationMetadata::External {
fetched_at: OffsetDateTime::now_utc(),
},
)
relationships,
conflict_behavior: ConflictBehavior::Fail,
provenance: *provenance,
conversions: conversions.clone(),
})
.await
.map_err(report_to_response)?,
))
Expand Down Expand Up @@ -601,15 +598,12 @@ where
})?;

store
.update_data_type(
actor_id,
UpdateDataTypesParams {
schema: data_type,
relationships,
provenance,
conversions,
},
)
.update_data_type(actor_id, UpdateDataTypesParams {
schema: data_type,
relationships,
provenance,
conversions,
})
.await
.map_err(|report| {
tracing::error!(error=?report, "Could not update data type");
Expand Down
Loading
Loading