Skip to content

Commit

Permalink
Merge #168
Browse files Browse the repository at this point in the history
168: Add AsTypeDescription for bytesize::ByteSize r=TheNeikos a=matthiasbeyer



Co-authored-by: Matthias Beyer <[email protected]>
  • Loading branch information
bors[bot] and matthiasbeyer authored Apr 14, 2023
2 parents 79c2e36 + 3a6112b commit 64bac97
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 0 deletions.
7 changes: 7 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ render = ["render_markdown", "render_terminal"]
render_markdown = ["dep:indexmap"]
render_terminal = ["dep:termimad", "dep:pretty", "dep:nu-ansi-term"]
bin = ["render", "dep:clap", "dep:serde_json", "dep:term_size"]
bytesize = ["dep:bytesize"]
url = ["dep:url"]
uuid = ["dep:uuid"]

Expand All @@ -38,6 +39,7 @@ term_size = { version = "0.3.2", optional = true }
termimad = { version = "0.23.0", optional = true }
type_description_derive = { version = "0.4.0", path = "type_description_derive" }

bytesize = { version = "1", optional = true }
url = { version = "2", optional = true }
uuid = { version = "1", optional = true }

Expand Down
3 changes: 3 additions & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -306,6 +306,9 @@ impl_config_kind!(TypeKind::String; "String"; "A socket address" => std::net::So
impl_config_kind!(TypeKind::String; "String"; "An IPv4 socket address" => std::net::SocketAddrV4);
impl_config_kind!(TypeKind::String; "String"; "An IPv6 socket address" => std::net::SocketAddrV6);

#[cfg(feature = "bytesize")]
impl_config_kind!(TypeKind::String; "String"; "A number of Bytes" => bytesize::ByteSize);

#[cfg(feature = "url")]
impl_config_kind!(TypeKind::String; "String"; "An URL" => url::Url);

Expand Down

0 comments on commit 64bac97

Please sign in to comment.