mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-04-27 23:18:01 +00:00
client/*: Treat protocol name as str and not [u8] (#6967)
* client/*: Treat protocol name as str and not [u8] Notification protocol names are in practice always valid utf8 strings. Instead of treating them as such in the type system, thus far they were casted to a [u8] at creation time. With this commit protocol names are instead treated as valid utf8 strings throughout the codebase and passed as `Cow<'static, str>` instead of `Cow<'static, [u8]>`. Among other things this eliminates the need for string casting when logging. * client/network: Don't allocate when protocol name is borrowed
This commit is contained in:
@@ -415,7 +415,7 @@ pub struct NetworkConfiguration {
|
||||
pub node_key: NodeKeyConfig,
|
||||
/// List of notifications protocols that the node supports. Must also include a
|
||||
/// `ConsensusEngineId` for backwards-compatibility.
|
||||
pub notifications_protocols: Vec<(ConsensusEngineId, Cow<'static, [u8]>)>,
|
||||
pub notifications_protocols: Vec<(ConsensusEngineId, Cow<'static, str>)>,
|
||||
/// List of request-response protocols that the node supports.
|
||||
pub request_response_protocols: Vec<RequestResponseConfig>,
|
||||
/// Maximum allowed number of incoming connections.
|
||||
|
||||
Reference in New Issue
Block a user