Closed ibc closed 8 months ago
Rust hates me:
error[E0204]: the trait `std::marker::Copy` cannot be implemented for this type
--> rust/src/data_structures.rs:52:17
|
52 | #[derive(Debug, Copy, Clone, Ord, PartialOrd, Eq, PartialEq, Hash, Deserialize, Serialize)]
| ^^^^
...
67 | pub flags: Option<Vec<SocketFlag>>,
| ---------------------------------- this field does not implement `std::marker::Copy`
|
note: the `std::marker::Copy` impl for `std::option::Option<std::vec::Vec<data_structures::SocketFlag>>` requires that `std::vec::Vec<data_structures::SocketFlag>: std::marker::Copy`
--> rust/src/data_structures.rs:67:16
|
67 | pub flags: Option<Vec<SocketFlag>>,
| ^^^^^^^^^^^^^^^^^^^^^^^
= note: this error originates in the derive macro `Copy` (in Nightly builds, run with -Z macro-backtrace for more info)
For more information about this error, try `rustc --explain E0204`.
Rust hates me:
It helps you write bug-free code. In this case Copy
can no longer be derived because Vec
is heap-allocated data structure rather than a bag of bytes. Remove Copy
from derive if you have to use a vector there.
It helps you write bug-free code. In this case
Copy
can no longer be derived becauseVec
is heap-allocated data structure rather than a bag of bytes. RemoveCopy
from derive if you have to use a vector there.
And what are the consequences of removing Copy from derive in that struct?
And what are the consequences of removing Copy from derive in that struct?
You'll have to call .clone()
on it rather than value being implicitly copied (like it happens with u8
for example). Clone
typically means there is some side effect of the cloning, in case of vector the biggest side effect is allocation of memory.
@jmillan I've pushed this: https://github.com/versatica/mediasoup/pull/1291/commits/a1405e23abee5dcfd13199d87c767fe5c331f4b6
I stumbled upon this. It would have been nice to mention the switch from setting UV_UDP_IPV6ONLY
by default to make it optional and user-supplied in the changelog as it was effectively a breaking change in behaviour.
I stumbled upon this. It would have been nice to mention the switch from setting
UV_UDP_IPV6ONLY
by default to make it optional and user-supplied in the changelog as it was effectively a breaking change in behaviour.
True. I've updated the PR description and added a note in the CHANGELOG file: https://github.com/versatica/mediasoup/commit/2854761ff1dc984d1d3f31cbf216319c085b2e12
Details
flags
option inTransportListenInfo
to specify socket flags.flags.ipv6Only
isfalse
by default, which is a behavior change.TODO