Skip to content
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
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 1 addition & 10 deletions examples/compute.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ enum ComputeProtocol {
Multiply(Multiply),
}

// Define ComputeRequest sub-messages
// Define ComputeProtocol sub-messages
#[derive(Debug, Serialize, Deserialize)]
struct Sqr {
num: u64,
Expand All @@ -53,15 +53,6 @@ struct Multiply {
initial: u64,
}

// Define ComputeRequest enum
#[derive(Debug, Serialize, Deserialize)]
enum ComputeRequest {
Sqr(Sqr),
Sum(Sum),
Fibonacci(Fibonacci),
Multiply(Multiply),
}

// The actor that processes requests
struct ComputeActor {
recv: tokio::sync::mpsc::Receiver<ComputeMessage>,
Expand Down
6 changes: 0 additions & 6 deletions examples/local.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,6 @@ struct Get {
key: String,
}

#[derive(Debug, Serialize, Deserialize)]
struct List;

#[derive(Debug, Serialize, Deserialize)]
struct Set {
key: String,
Expand All @@ -29,9 +26,6 @@ impl From<(String, String)> for Set {
}
}

#[derive(Debug, Serialize, Deserialize)]
struct SetMany;

#[rpc_requests(message = StorageMessage, no_rpc, no_spans)]
#[derive(Serialize, Deserialize, Debug)]
enum StorageProtocol {
Expand Down
18 changes: 10 additions & 8 deletions src/util.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,12 @@ mod quinn_setup_utils {
certs.add(cert)?;
}

let crypto_client_config = rustls::ClientConfig::builder_with_provider(Arc::new(
rustls::crypto::ring::default_provider(),
))
.with_protocol_versions(&[&rustls::version::TLS13])
.expect("valid versions")
.with_root_certificates(certs)
.with_no_client_auth();
let provider = rustls::crypto::ring::default_provider();
let crypto_client_config = rustls::ClientConfig::builder_with_provider(Arc::new(provider))
.with_protocol_versions(&[&rustls::version::TLS13])
.expect("valid versions")
.with_root_certificates(certs)
.with_no_client_auth();
Comment on lines -25 to +30
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No change here, just pulling out let provider for better formatting.

let quic_client_config =
quinn::crypto::rustls::QuicClientConfig::try_from(crypto_client_config)?;

Expand All @@ -54,7 +53,10 @@ mod quinn_setup_utils {

/// Create a quinn client config and trust all certificates.
pub fn configure_client_insecure() -> Result<ClientConfig> {
let crypto = rustls::ClientConfig::builder()
let provider = rustls::crypto::ring::default_provider();
let crypto = rustls::ClientConfig::builder_with_provider(Arc::new(provider))
.with_protocol_versions(rustls::DEFAULT_VERSIONS)
.expect("valid versions")
.dangerous()
.with_custom_certificate_verifier(Arc::new(SkipServerVerification))
.with_no_client_auth();
Expand Down
2 changes: 2 additions & 0 deletions tests/derive.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ use serde::{Deserialize, Serialize};

#[test]
fn derive_simple() {
#![allow(dead_code)]

#[derive(Debug, Serialize, Deserialize)]
struct RpcRequest;

Expand Down
Loading