diff options
author | Cyborus <cyborus@cyborus.xyz> | 2024-04-26 19:08:24 +0200 |
---|---|---|
committer | Cyborus <cyborus@cyborus.xyz> | 2024-04-26 19:08:24 +0200 |
commit | c3dcafc684524c18abb1b116c80e5fbf1ba9d618 (patch) | |
tree | a4596400fd3f12005353ebb28cf831131c8739ec /src/lib.rs | |
parent | regenerate source (diff) | |
download | forgejo-api-c3dcafc684524c18abb1b116c80e5fbf1ba9d618.tar.xz forgejo-api-c3dcafc684524c18abb1b116c80e5fbf1ba9d618.zip |
implement `From<DefaultMergeStyle>` for `MergePullRequestOptionDo`
Diffstat (limited to '')
-rw-r--r-- | src/lib.rs | 16 |
1 files changed, 16 insertions, 0 deletions
@@ -253,3 +253,19 @@ fn none_if_blank_url<'de, D: serde::Deserializer<'de>>( deserializer.deserialize_str(EmptyUrlVisitor) } + +impl From<structs::DefaultMergeStyle> for structs::MergePullRequestOptionDo { + fn from(value: structs::DefaultMergeStyle) -> Self { + match value { + structs::DefaultMergeStyle::Merge => structs::MergePullRequestOptionDo::Merge, + structs::DefaultMergeStyle::Rebase => structs::MergePullRequestOptionDo::Rebase, + structs::DefaultMergeStyle::RebaseMerge => { + structs::MergePullRequestOptionDo::RebaseMerge + } + structs::DefaultMergeStyle::Squash => structs::MergePullRequestOptionDo::Squash, + structs::DefaultMergeStyle::FastForwardOnly => { + structs::MergePullRequestOptionDo::FastForwardOnly + } + } + } +} |