Removed extra init method for context
This commit is contained in:
2 files changed
+2
-18
No files matched your search
+1
-16
@@ -130,23 +130,8 @@ impl Bc {
|
||||
}
|
||||
}
|
||||
|
||||
impl Default for BcContext {
|
||||
fn default() -> BcContext {
|
||||
Self::new()
|
||||
}
|
||||
}
|
||||
|
||||
impl BcContext {
|
||||
pub fn new() -> BcContext {
|
||||
BcContext {
|
||||
in_bin_mode: HashSet::new(),
|
||||
encryption_protocol: Arc::new(Mutex::new(EncryptionProtocol::Unencrypted)),
|
||||
}
|
||||
}
|
||||
|
||||
pub fn new_with_encryption_protocol(
|
||||
encryption_protocol: Arc<Mutex<EncryptionProtocol>>,
|
||||
) -> BcContext {
|
||||
pub fn new(encryption_protocol: Arc<Mutex<EncryptionProtocol>>) -> BcContext {
|
||||
BcContext {
|
||||
in_bin_mode: HashSet::new(),
|
||||
encryption_protocol,
|
||||
|
||||
@@ -60,8 +60,7 @@ impl BcConnection {
|
||||
let encryption_protocol = Arc::new(Mutex::new(EncryptionProtocol::Unencrypted));
|
||||
let connections_encryption_protocol = encryption_protocol.clone();
|
||||
let rx_thread = std::thread::spawn(move || {
|
||||
let mut context =
|
||||
BcContext::new_with_encryption_protocol(connections_encryption_protocol);
|
||||
let mut context = BcContext::new(connections_encryption_protocol);
|
||||
let mut result;
|
||||
while {
|
||||
result = BcConnection::poll(&mut context, &conn, &mut subs);
|
||||
|
||||
Reference in new issue
Block a user