Skip to content

Commit

Permalink
Merge branch 'main' into feature/display_trait_enum
Browse files Browse the repository at this point in the history
  • Loading branch information
Prince Kumar Maurya committed Feb 6, 2024
2 parents 7fea450 + af8be41 commit 119b2cf
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 5 deletions.
10 changes: 8 additions & 2 deletions CHANGELOG.next.toml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,13 @@ meta = { "breaking" = false, "bug" = false, "tada" = false }
author = "rcoh"

[[smithy-rs]]
message = "Added impl Display trait to Enum."
references = ["smithy-rs#3336"]
message = "Added impl `Display` to Enums."
references = ["smithy-rs#3336","smithy-rs#3391"]
meta = { "breaking" = false, "tada" = false, "bug" = false , "target" = "client" }
author = "iampkmone"

[[aws-sdk-rust]]
message = "Added impl `Display` to Enums."
references = ["smithy-rs#3336", "smithy-rs#3391"]
meta = { "breaking" = false, "tada" = false, "bug" = false}
author = "iampkmone"
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ data class InfallibleEnumType(
""",
)
}
rust(""" ${context.enumName}::Unknown(value) => write!(f,"{}",value) """)
rust("""${context.enumName}::Unknown(value) => write!(f,"{}",value)""")
},
)
}
Expand Down Expand Up @@ -170,7 +170,7 @@ data class InfallibleEnumType(
"""
impl #{Display} for $UnknownVariantValue {
fn fmt(&self, f: &mut #{Fmt}::Formatter) -> #{Fmt}::Result {
write!(f,"{}",self.0)
write!(f, "{}", self.0)
}
}
""",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ class ClientEnumGeneratorTest {
"""
assert_eq!(format!("{:?}", SomeEnum::Foo), "Foo");
assert_eq!(format!("{:?}", SomeEnum::Bar), "Bar");
assert_eq!(SomeEnum::Foo.to_string(), "Foo");
assert_eq!(format!("{}", SomeEnum::Foo), "Foo");
assert_eq!(SomeEnum::Bar.to_string(), "Bar");
assert_eq!(
format!("{:?}", SomeEnum::from("Baz")),
Expand Down

0 comments on commit 119b2cf

Please sign in to comment.