refactor done for native
This commit is contained in:
@@ -49,12 +49,7 @@ impl NodeRef {
|
||||
// Returns the best dial info to attempt a connection to this node
|
||||
pub fn best_dial_info(&self) -> Option<DialInfo> {
|
||||
let nm = self.routing_table.network_manager();
|
||||
let protocol_config = nm.get_protocol_config();
|
||||
if protocol_config.is_none() {
|
||||
return None;
|
||||
}
|
||||
let protocol_config = protocol_config.unwrap();
|
||||
|
||||
let protocol_config = nm.get_protocol_config()?;
|
||||
self.operate(|e| {
|
||||
e.first_filtered_dial_info(|di| {
|
||||
// Does it match the dial info filter
|
||||
@@ -99,7 +94,7 @@ impl Clone for NodeRef {
|
||||
|
||||
impl fmt::Debug for NodeRef {
|
||||
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
|
||||
let out = format!("{}", self.node_id.encode());
|
||||
let mut out = self.node_id.encode();
|
||||
if !self.dial_info_filter.is_empty() {
|
||||
out += &format!("{:?}", self.dial_info_filter);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user