KallDrexx / rust-media-libs

Rust based libraries for misc media functionality
Apache License 2.0
229 stars 58 forks source link

Fix threaded_rtmp_server example #8

Closed haileys closed 4 years ago

haileys commented 4 years ago

examples/threaded_rtmp_server currently fails to compile on master with this error:

error[E0382]: assign to part of moved value: `connection`
  --> examples/threaded_rtmp_server/src/main.rs:45:17
   |
43 |                 let mut connection = Connection::new(stream);
   |                     -------------- move occurs because `connection` has type `connection::Connection`, which does not implement the `Copy` trait
44 |                 let id = connections.insert(connection);
   |                                             ---------- value moved here
45 |                 connection.connection_id = Some(id);
   |                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ value partially assigned here after move

It doesn't look like the connection_id field on Connection is still in use, so I have removed it to fix the build.

KallDrexx commented 4 years ago

Thanks for submitting this. I got 2 PRs at the exact same time to fix it, I took the other PR for no particular reason (had to choose one or the other) but I do appreciate it.