summaryrefslogtreecommitdiffstats
path: root/src/lib.rs
diff options
context:
space:
mode:
authorCyborus <cyborus@cyborus.xyz>2024-04-26 19:08:24 +0200
committerCyborus <cyborus@cyborus.xyz>2024-04-26 19:08:24 +0200
commitc3dcafc684524c18abb1b116c80e5fbf1ba9d618 (patch)
treea4596400fd3f12005353ebb28cf831131c8739ec /src/lib.rs
parentregenerate source (diff)
downloadforgejo-api-c3dcafc684524c18abb1b116c80e5fbf1ba9d618.tar.xz
forgejo-api-c3dcafc684524c18abb1b116c80e5fbf1ba9d618.zip
implement `From<DefaultMergeStyle>` for `MergePullRequestOptionDo`
Diffstat (limited to '')
-rw-r--r--src/lib.rs16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/lib.rs b/src/lib.rs
index 3a53fcb..90d1137 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -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
+ }
+ }
+ }
+}