@@ -61,14 +61,14 @@ pub struct Behaviour {
6161impl Behaviour {
6262 /// Creates a new [`Behaviour`] with the given configuration.
6363 pub fn new ( config : Config ) -> Self {
64- let name = config. local_info ( ) . nickname . clone ( ) ;
64+ let name = & config. local_info ( ) . nickname ;
6565
6666 PEERINFO_METRICS . version
67- [ & PeerVersionLabels :: new ( & name, & config. local_info ( ) . charon_version ) ]
67+ [ & PeerVersionLabels :: new ( name, & config. local_info ( ) . charon_version ) ]
6868 . set ( 1 ) ;
69- PEERINFO_METRICS . git_commit [ & PeerGitHashLabels :: new ( & name, & config. local_info ( ) . git_hash ) ]
69+ PEERINFO_METRICS . git_commit [ & PeerGitHashLabels :: new ( name, & config. local_info ( ) . git_hash ) ]
7070 . set ( 1 ) ;
71- PEERINFO_METRICS . nickname [ & PeerNicknameLabels :: new ( & name, & config. local_info ( ) . nickname ) ]
71+ PEERINFO_METRICS . nickname [ & PeerNicknameLabels :: new ( name, & config. local_info ( ) . nickname ) ]
7272 . set ( 1 ) ;
7373
7474 let started_at = if let Some ( started_at) = config. local_info ( ) . started_at {
@@ -77,12 +77,12 @@ impl Behaviour {
7777 chrono:: Utc :: now ( ) . timestamp ( )
7878 } ;
7979
80- PEERINFO_METRICS . start_time_secs [ & name] . set ( started_at) ;
80+ PEERINFO_METRICS . start_time_secs [ name] . set ( started_at) ;
8181
8282 if config. local_info ( ) . builder_api_enabled {
83- PEERINFO_METRICS . builder_api_enabled [ & name] . set ( 1 ) ;
83+ PEERINFO_METRICS . builder_api_enabled [ name] . set ( 1 ) ;
8484 } else {
85- PEERINFO_METRICS . builder_api_enabled [ & name] . set ( 0 ) ;
85+ PEERINFO_METRICS . builder_api_enabled [ name] . set ( 0 ) ;
8686 }
8787
8888 for ( idx, peer) in config. peers ( ) . iter ( ) . enumerate ( ) {
0 commit comments