Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Arti
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Jill
Arti
Commits
bb1d59e0
Commit
bb1d59e0
authored
3 years ago
by
Ian Jackson
Browse files
Options
Downloads
Patches
Plain Diff
Replace manual Default impl with educe in tor-cell
parent
ac0ed6ab
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
crates/tor-cell/src/relaycell/msg.rs
+4
-6
4 additions, 6 deletions
crates/tor-cell/src/relaycell/msg.rs
with
4 additions
and
6 deletions
crates/tor-cell/src/relaycell/msg.rs
+
4
−
6
View file @
bb1d59e0
...
...
@@ -7,6 +7,7 @@ use super::RelayCmd;
use
crate
::
chancell
::
msg
::{
DestroyReason
,
TAP_C_HANDSHAKE_LEN
,
TAP_S_HANDSHAKE_LEN
};
use
crate
::
chancell
::
CELL_DATA_LEN
;
use
caret
::
caret_int
;
use
educe
::
Educe
;
use
std
::
convert
::
TryInto
;
use
std
::
net
::{
IpAddr
,
Ipv4Addr
};
use
tor_bytes
::{
Error
,
Result
};
...
...
@@ -163,12 +164,14 @@ impl From<u32> for BeginFlags {
/// A preference for IPv4 vs IPv6 addresses; usable as a nicer frontend for
/// BeginFlags.
#[derive(Clone,
Copy,
Debug,
Eq,
PartialEq)]
#[derive(Clone,
Copy,
Debug,
Eq,
PartialEq
,
Educe
)]
#[non_exhaustive]
#[educe(Default)]
pub
enum
IpVersionPreference
{
/// Only IPv4 is allowed.
Ipv4Only
,
/// IPv4 and IPv6 are both allowed, and IPv4 is preferred.
#[educe(Default)]
Ipv4Preferred
,
/// IPv4 and IPv6 are both allowed, and IPv6 is preferred.
Ipv6Preferred
,
...
...
@@ -186,11 +189,6 @@ impl From<IpVersionPreference> for BeginFlags {
}
}
}
impl
Default
for
IpVersionPreference
{
fn
default
()
->
Self
{
IpVersionPreference
::
Ipv4Preferred
}
}
/// A Begin message creates a new data stream.
///
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment