Skip to content

Commit b712fe6

Browse files
authored
Add support for std::net::Ipv6Addr type (#38)
Add support for std::net::Ipv6Addr type Also fix non-exhaustive patterns issue.
1 parent 9afa917 commit b712fe6

File tree

4 files changed

+372
-370
lines changed

4 files changed

+372
-370
lines changed

typify-impl/src/convert.rs

+2
Original file line numberDiff line numberDiff line change
@@ -408,6 +408,8 @@ impl TypeSpace {
408408
))
409409
}
410410

411+
Some("ipv6") => Ok((TypeEntry::new_builtin("std::net::Ipv6Addr"), metadata)),
412+
411413
// TODO random types I'm not sure what to do with
412414
Some("uri" | "uri-template" | "email" | "ip") => {
413415
Ok((TypeEntryDetails::String.into(), metadata))

typify-impl/src/enums.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -866,7 +866,7 @@ pub(crate) fn enum_impl(type_name: &Ident, variants: &[Variant]) -> TokenStream
866866
quote! {
867867
impl ToString for #type_name {
868868
fn to_string(&self) -> String {
869-
match self {
869+
match *self {
870870
#(#match_variants),*
871871
}
872872
}

typify-impl/tests/generator.out

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ mod types {
1616
}
1717
impl ToString for StringEnum {
1818
fn to_string(&self) -> String {
19-
match self {
19+
match *self {
2020
StringEnum::One => "One".to_string(),
2121
StringEnum::Two => "Two".to_string(),
2222
StringEnum::BuckleMyShoe => "BuckleMyShoe".to_string(),

0 commit comments

Comments
 (0)