mirror of
https://github.com/tlsnotary/tlsn.git
synced 2026-01-08 21:08:04 -05:00
chore: bump rust version, fix lints and satisfy clippy (#964)
* chore(lints): fix lints and satisfy clippy * bump rust version in ci
This commit is contained in:
4
.github/workflows/ci.yml
vendored
4
.github/workflows/ci.yml
vendored
@@ -21,7 +21,7 @@ env:
|
||||
# - https://github.com/privacy-scaling-explorations/mpz/issues/178
|
||||
# 32 seems to be big enough for the foreseeable future
|
||||
RAYON_NUM_THREADS: 32
|
||||
RUST_VERSION: 1.88.0
|
||||
RUST_VERSION: 1.89.0
|
||||
|
||||
jobs:
|
||||
clippy:
|
||||
@@ -198,4 +198,4 @@ jobs:
|
||||
draft: true
|
||||
tag_name: ${{ github.ref_name }}
|
||||
prerelease: true
|
||||
generate_release_notes: true
|
||||
generate_release_notes: true
|
||||
|
||||
@@ -36,7 +36,7 @@ pub struct Request {
|
||||
|
||||
impl Request {
|
||||
/// Returns a new request builder.
|
||||
pub fn builder(config: &RequestConfig) -> RequestBuilder {
|
||||
pub fn builder(config: &RequestConfig) -> RequestBuilder<'_> {
|
||||
RequestBuilder::new(config)
|
||||
}
|
||||
|
||||
|
||||
@@ -32,7 +32,7 @@ pub struct ProveConfig {
|
||||
|
||||
impl ProveConfig {
|
||||
/// Creates a new builder.
|
||||
pub fn builder(transcript: &Transcript) -> ProveConfigBuilder {
|
||||
pub fn builder(transcript: &Transcript) -> ProveConfigBuilder<'_> {
|
||||
ProveConfigBuilder::new(transcript)
|
||||
}
|
||||
|
||||
|
||||
@@ -76,7 +76,7 @@ pub struct TranscriptCommitConfig {
|
||||
|
||||
impl TranscriptCommitConfig {
|
||||
/// Creates a new commit config builder.
|
||||
pub fn builder(transcript: &Transcript) -> TranscriptCommitConfigBuilder {
|
||||
pub fn builder(transcript: &Transcript) -> TranscriptCommitConfigBuilder<'_> {
|
||||
TranscriptCommitConfigBuilder::new(transcript)
|
||||
}
|
||||
|
||||
|
||||
@@ -182,7 +182,7 @@ impl ConnectionCommon {
|
||||
}
|
||||
|
||||
/// Returns an object that allows reading plaintext.
|
||||
pub fn reader(&mut self) -> Reader {
|
||||
pub fn reader(&mut self) -> Reader<'_> {
|
||||
Reader {
|
||||
received_plaintext: &mut self.common_state.received_plaintext,
|
||||
// Are we done? i.e., have we processed all received messages, and received a
|
||||
|
||||
@@ -888,7 +888,7 @@ async fn client_error_is_sticky() {
|
||||
}
|
||||
|
||||
#[tokio::test]
|
||||
#[allow(clippy::no_effect)]
|
||||
#[allow(clippy::unnecessary_operation)]
|
||||
async fn client_is_send() {
|
||||
let (client, _) = make_pair(KeyType::Rsa).await;
|
||||
&client as &dyn Send;
|
||||
|
||||
@@ -13,7 +13,7 @@ pub struct OwnedTrustAnchor {
|
||||
|
||||
impl OwnedTrustAnchor {
|
||||
/// Get a `webpki::TrustAnchor` by borrowing the owned elements.
|
||||
pub(crate) fn to_trust_anchor(&self) -> webpki::TrustAnchor {
|
||||
pub(crate) fn to_trust_anchor(&self) -> webpki::TrustAnchor<'_> {
|
||||
webpki::TrustAnchor {
|
||||
subject: &self.subject,
|
||||
spki: &self.spki,
|
||||
|
||||
@@ -37,7 +37,7 @@ impl ServerName {
|
||||
/// Return the name that should go in the SNI extension.
|
||||
/// If [`None`] is returned, the SNI extension is not included
|
||||
/// in the handshake.
|
||||
pub fn for_sni(&self) -> Option<webpki::DnsNameRef> {
|
||||
pub fn for_sni(&self) -> Option<webpki::DnsNameRef<'_>> {
|
||||
match self {
|
||||
Self::DnsName(dns_name) => Some(dns_name.0.as_ref()),
|
||||
}
|
||||
|
||||
@@ -7,7 +7,7 @@ pub struct Reader<'a> {
|
||||
}
|
||||
|
||||
impl Reader<'_> {
|
||||
pub fn init(bytes: &[u8]) -> Reader {
|
||||
pub fn init(bytes: &[u8]) -> Reader<'_> {
|
||||
Reader {
|
||||
buf: bytes,
|
||||
offs: 0,
|
||||
@@ -42,7 +42,7 @@ impl Reader<'_> {
|
||||
self.offs
|
||||
}
|
||||
|
||||
pub fn sub(&mut self, len: usize) -> Option<Reader> {
|
||||
pub fn sub(&mut self, len: usize) -> Option<Reader<'_>> {
|
||||
self.take(len).map(Reader::init)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -313,7 +313,7 @@ declare_u16_vec!(ServerNameRequest, ServerName);
|
||||
|
||||
pub trait ConvertServerNameList {
|
||||
fn has_duplicate_names_for_type(&self) -> bool;
|
||||
fn get_single_hostname(&self) -> Option<webpki::DnsNameRef>;
|
||||
fn get_single_hostname(&self) -> Option<webpki::DnsNameRef<'_>>;
|
||||
}
|
||||
|
||||
impl ConvertServerNameList for ServerNameRequest {
|
||||
@@ -330,8 +330,8 @@ impl ConvertServerNameList for ServerNameRequest {
|
||||
false
|
||||
}
|
||||
|
||||
fn get_single_hostname(&self) -> Option<webpki::DnsNameRef> {
|
||||
fn only_dns_hostnames(name: &ServerName) -> Option<webpki::DnsNameRef> {
|
||||
fn get_single_hostname(&self) -> Option<webpki::DnsNameRef<'_>> {
|
||||
fn only_dns_hostnames(name: &ServerName) -> Option<webpki::DnsNameRef<'_>> {
|
||||
if let ServerNamePayload::HostName((_, ref dns)) = name.payload {
|
||||
Some(dns.as_ref())
|
||||
} else {
|
||||
|
||||
@@ -190,22 +190,22 @@ impl ProtocolConfigValidator {
|
||||
max_sent_records: Option<usize>,
|
||||
max_recv_records_online: Option<usize>,
|
||||
) -> Result<(), ProtocolConfigError> {
|
||||
if let Some(max_sent_records) = max_sent_records {
|
||||
if max_sent_records > self.max_sent_records {
|
||||
return Err(ProtocolConfigError::max_record_count(format!(
|
||||
"max_sent_records {} is greater than the configured limit {}",
|
||||
max_sent_records, self.max_sent_records,
|
||||
)));
|
||||
}
|
||||
if let Some(max_sent_records) = max_sent_records
|
||||
&& max_sent_records > self.max_sent_records
|
||||
{
|
||||
return Err(ProtocolConfigError::max_record_count(format!(
|
||||
"max_sent_records {} is greater than the configured limit {}",
|
||||
max_sent_records, self.max_sent_records,
|
||||
)));
|
||||
}
|
||||
|
||||
if let Some(max_recv_records_online) = max_recv_records_online {
|
||||
if max_recv_records_online > self.max_recv_records_online {
|
||||
return Err(ProtocolConfigError::max_record_count(format!(
|
||||
"max_recv_records_online {} is greater than the configured limit {}",
|
||||
max_recv_records_online, self.max_recv_records_online,
|
||||
)));
|
||||
}
|
||||
if let Some(max_recv_records_online) = max_recv_records_online
|
||||
&& max_recv_records_online > self.max_recv_records_online
|
||||
{
|
||||
return Err(ProtocolConfigError::max_record_count(format!(
|
||||
"max_recv_records_online {} is greater than the configured limit {}",
|
||||
max_recv_records_online, self.max_recv_records_online,
|
||||
)));
|
||||
}
|
||||
|
||||
Ok(())
|
||||
|
||||
Reference in New Issue
Block a user