File tree 2 files changed +17
-2
lines changed
2 files changed +17
-2
lines changed Original file line number Diff line number Diff line change @@ -351,7 +351,7 @@ pub enum QueueType {
351
351
352
352
impl From < & str > for QueueType {
353
353
fn from ( value : & str ) -> Self {
354
- match value {
354
+ match value. to_ascii_lowercase ( ) . as_str ( ) {
355
355
"classic" => QueueType :: Classic ,
356
356
"quorum" => QueueType :: Quorum ,
357
357
"stream" => QueueType :: Stream ,
@@ -363,7 +363,7 @@ impl From<&str> for QueueType {
363
363
364
364
impl From < String > for QueueType {
365
365
fn from ( value : String ) -> Self {
366
- match value. as_str ( ) {
366
+ match value. to_ascii_lowercase ( ) . as_str ( ) {
367
367
"classic" => QueueType :: Classic ,
368
368
"quorum" => QueueType :: Quorum ,
369
369
"stream" => QueueType :: Stream ,
Original file line number Diff line number Diff line change @@ -19,6 +19,21 @@ use rabbitmq_http_client::responses::{
19
19
} ;
20
20
use serde_json:: { json, Map } ;
21
21
22
+ #[ test]
23
+ fn test_unit_queue_type_from_str ( ) {
24
+ assert_eq ! ( QueueType :: Classic , QueueType :: from( "classic" ) ) ;
25
+ assert_eq ! ( QueueType :: Classic , QueueType :: from( "Classic" ) ) ;
26
+
27
+ assert_eq ! ( QueueType :: Quorum , QueueType :: from( "quorum" ) ) ;
28
+ assert_eq ! ( QueueType :: Quorum , QueueType :: from( "Quorum" ) ) ;
29
+
30
+ assert_eq ! ( QueueType :: Stream , QueueType :: from( "stream" ) ) ;
31
+ assert_eq ! ( QueueType :: Stream , QueueType :: from( "Stream" ) ) ;
32
+
33
+ assert_eq ! ( QueueType :: Delayed , QueueType :: from( "delayed" ) ) ;
34
+ assert_eq ! ( QueueType :: Delayed , QueueType :: from( "Delayed" ) ) ;
35
+ }
36
+
22
37
#[ test]
23
38
fn test_unit_policy_target_type_case1 ( ) {
24
39
let input = r#"{
You can’t perform that action at this time.
0 commit comments