@@ -23,8 +23,8 @@ use std::time::Duration;
2323use crate :: config:: {
2424 cluster:: Cluster , common:: is_default, core:: Address , listener:: Listener , metrics:: StatsSink , secret:: Secret ,
2525} ;
26- use compact_str:: CompactString ;
2726use serde:: { Deserialize , Serialize } ;
27+ use smol_str:: SmolStr ;
2828
2929#[ derive( Debug , Clone , Serialize , Deserialize , Default , PartialEq ) ]
3030pub struct Bootstrap {
@@ -43,15 +43,15 @@ pub struct Bootstrap {
4343}
4444
4545impl Bootstrap {
46- pub fn get_ads_configs ( & self ) -> & [ CompactString ] {
46+ pub fn get_ads_configs ( & self ) -> & [ SmolStr ] {
4747 self . dynamic_resources . as_ref ( ) . map ( |dr| dr. grpc_cluster_specifiers . as_slice ( ) ) . unwrap_or_default ( )
4848 }
4949}
5050
5151#[ derive( Debug , Clone , Serialize , Deserialize , PartialEq , Eq , Default ) ]
5252pub struct Node {
53- pub id : CompactString ,
54- pub cluster_id : CompactString ,
53+ pub id : SmolStr ,
54+ pub cluster_id : SmolStr ,
5555}
5656
5757impl Node {
@@ -68,7 +68,7 @@ impl Node {
6868
6969#[ derive( Debug , Clone , Serialize , Deserialize , PartialEq , Eq ) ]
7070pub struct DynamicResources {
71- pub grpc_cluster_specifiers : Vec < CompactString > ,
71+ pub grpc_cluster_specifiers : Vec < SmolStr > ,
7272}
7373
7474#[ derive( Debug , Clone , Serialize , Deserialize , PartialEq , Eq ) ]
@@ -91,7 +91,6 @@ mod envoy_conversions {
9191 #![ allow( deprecated) ]
9292 use super :: { Admin , Bootstrap , DynamicResources , Node , StaticResources } ;
9393 use crate :: config:: { common:: * , grpc:: Duration , metrics:: StatsSink } ;
94- use compact_str:: CompactString ;
9594 use orion_data_plane_api:: envoy_data_plane_api:: envoy:: config:: {
9695 bootstrap:: v3:: {
9796 bootstrap:: { DynamicResources as EnvoyDynamicResources , StaticResources as EnvoyStaticResources } ,
@@ -104,6 +103,7 @@ mod envoy_conversions {
104103 } ,
105104 metrics:: v3:: stats_sink:: ConfigType ,
106105 } ;
106+ use smol_str:: SmolStr ;
107107
108108 impl Bootstrap {
109109 pub fn deserialize_from_envoy < R : std:: io:: Read > ( rdr : R ) -> Result < Self , GenericError > {
@@ -313,7 +313,7 @@ mod envoy_conversions {
313313 )
314314 . with_node ( "target_specifier" ) ?;
315315 let cluster_name = required ! ( cluster_name) . with_node ( "target_specifier" ) ?;
316- cluster_specifiers. push ( CompactString :: from ( cluster_name) )
316+ cluster_specifiers. push ( SmolStr :: from ( cluster_name) )
317317 } ,
318318 EnvoyGrpcTargetSpecifier :: GoogleGrpc ( _) => {
319319 return Err ( GenericError :: unsupported_variant ( "GoogleGrpc" ) )
0 commit comments