@@ -568,8 +568,8 @@ pub async fn get_stream_info(stream_name: Path<String>) -> Result<impl Responder
568568 . get ( & stream_name)
569569 . ok_or ( StreamError :: StreamNotFound ( stream_name. clone ( ) ) ) ?;
570570
571- let stream_info: StreamInfo = StreamInfo {
572- stream_type : stream_meta. stream_type . clone ( ) ,
571+ let stream_info = StreamInfo {
572+ stream_type : stream_meta. stream_type ,
573573 created_at : stream_meta. created_at . clone ( ) ,
574574 first_event_at : stream_first_event_at,
575575 time_partition : stream_meta. time_partition . clone ( ) ,
@@ -603,7 +603,10 @@ pub async fn put_stream_hot_tier(
603603 }
604604 }
605605
606- if STREAM_INFO . stream_type ( & stream_name) . unwrap ( ) == Some ( StreamType :: Internal . to_string ( ) ) {
606+ if STREAM_INFO
607+ . stream_type ( & stream_name)
608+ . is_ok_and ( |t| t == StreamType :: Internal )
609+ {
607610 return Err ( StreamError :: Custom {
608611 msg : "Hot tier can not be updated for internal stream" . to_string ( ) ,
609612 status : StatusCode :: BAD_REQUEST ,
@@ -686,7 +689,10 @@ pub async fn delete_stream_hot_tier(
686689 return Err ( StreamError :: HotTierNotEnabled ( stream_name) ) ;
687690 } ;
688691
689- if STREAM_INFO . stream_type ( & stream_name) . unwrap ( ) == Some ( StreamType :: Internal . to_string ( ) ) {
692+ if STREAM_INFO
693+ . stream_type ( & stream_name)
694+ . is_ok_and ( |t| t == StreamType :: Internal )
695+ {
690696 return Err ( StreamError :: Custom {
691697 msg : "Hot tier can not be deleted for internal stream" . to_string ( ) ,
692698 status : StatusCode :: BAD_REQUEST ,
0 commit comments