Skip to content

Commit c535de9

Browse files
chore: Remove dead code (#2880)
* chore: Remove dead code Based on coverage. We should check if there is some code that _should_ have been called... * Restore some bits needed by Gecko, and add TODOs for them. * Apply suggestion from @martinthomson Co-authored-by: Martin Thomson <[email protected]> Signed-off-by: Lars Eggert <[email protected]> * fmt * write_frames_with_early_return -> write_frames. Remove one qtrace. * Restore some WT code we might want to call from gecko. * Fix comment --------- Signed-off-by: Lars Eggert <[email protected]> Co-authored-by: Martin Thomson <[email protected]>
1 parent 4d17dea commit c535de9

File tree

35 files changed

+34
-390
lines changed

35 files changed

+34
-390
lines changed

neqo-bin/src/client/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -436,7 +436,7 @@ impl<'a, H: Handler> Runner<'a, H> {
436436
handler,
437437
args,
438438
timeout: None,
439-
recv_buf: RecvBuf::new(),
439+
recv_buf: RecvBuf::default(),
440440
}
441441
}
442442

neqo-bin/src/server/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -280,7 +280,7 @@ impl<S: HttpServer> Runner<S> {
280280
server,
281281
timeout: None,
282282
sockets,
283-
recv_buf: RecvBuf::new(),
283+
recv_buf: RecvBuf::default(),
284284
}
285285
}
286286

neqo-common/src/codec.rs

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -493,12 +493,6 @@ impl<B: Buffer> AsMut<[u8]> for Encoder<B> {
493493
}
494494
}
495495

496-
impl<'a> From<Decoder<'a>> for Encoder {
497-
fn from(dec: Decoder<'a>) -> Self {
498-
Self::from(&dec.buf[dec.offset..])
499-
}
500-
}
501-
502496
impl From<&[u8]> for Encoder {
503497
fn from(buf: &[u8]) -> Self {
504498
Self {

neqo-common/src/qlog.rs

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -82,11 +82,6 @@ impl Qlog {
8282
})
8383
}
8484

85-
#[must_use]
86-
pub fn inner(&self) -> Rc<RefCell<Option<SharedStreamer>>> {
87-
Rc::clone(&self.inner)
88-
}
89-
9085
/// Create a disabled `Qlog` configuration.
9186
#[must_use]
9287
pub fn disabled() -> Self {

neqo-crypto/src/aead.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
use std::{
88
fmt,
9-
ops::{Deref, DerefMut},
9+
ops::Deref,
1010
os::raw::{c_char, c_uint},
1111
ptr::null_mut,
1212
};

neqo-crypto/src/agent.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -414,6 +414,7 @@ impl SecretAgentInfo {
414414
pub const fn alpn(&self) -> Option<&String> {
415415
self.alpn.as_ref()
416416
}
417+
// TODO: Not used in neqo, but Gecko calls it. Needs a test to call it.
417418
#[must_use]
418419
pub const fn signature_scheme(&self) -> SignatureScheme {
419420
self.signature_scheme

neqo-crypto/src/auth.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ impl From<AuthenticationStatus> for PRErrorCode {
4444

4545
// Note that this mapping should be removed after gecko eventually learns how to
4646
// map into the enumerated type.
47+
// TODO: Not used in neqo, but Gecko calls it. Needs a test to call it.
4748
impl From<PRErrorCode> for AuthenticationStatus {
4849
fn from(v: PRErrorCode) -> Self {
4950
Self::from_repr(v).unwrap_or(Self::Unknown)

neqo-crypto/src/cert.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,11 +94,13 @@ impl CertificateInfo {
9494
self.certs.into_iter()
9595
}
9696

97+
// TODO: Not used in neqo, but Gecko calls it. Needs a test to call it.
9798
#[must_use]
9899
pub const fn stapled_ocsp_responses(&self) -> Option<&Vec<Vec<u8>>> {
99100
self.stapled_ocsp_responses.as_ref()
100101
}
101102

103+
// TODO: Not used in neqo, but Gecko calls it. Needs a test to call it.
102104
#[must_use]
103105
pub const fn signed_cert_timestamp(&self) -> Option<&Vec<u8>> {
104106
self.signed_cert_timestamp.as_ref()

neqo-crypto/src/p11.rs

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
use std::{
88
cell::RefCell,
99
fmt::{self, Debug, Formatter},
10-
ops::{Deref, DerefMut},
10+
ops::Deref,
1111
os::raw::c_uint,
1212
ptr::null_mut,
1313
slice::Iter as SliceIter,
@@ -68,12 +68,6 @@ macro_rules! scoped_ptr {
6868
}
6969
}
7070

71-
impl DerefMut for $scoped {
72-
fn deref_mut(&mut self) -> &mut *mut $target {
73-
&mut self.ptr
74-
}
75-
}
76-
7771
impl Drop for $scoped {
7872
fn drop(&mut self) {
7973
unsafe { _ = $dtor(self.ptr) };

neqo-crypto/src/replay.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
// except according to those terms.
66

77
use std::{
8-
ops::{Deref, DerefMut},
8+
ops::Deref,
99
os::raw::c_uint,
1010
ptr::null_mut,
1111
time::{Duration, Instant},

0 commit comments

Comments
 (0)