feat: implement Default for CreateRepoOptions

This commit is contained in:
aviac 2023-09-22 20:44:11 +02:00
parent b5d57249fa
commit 6c6f992ef9
No known key found for this signature in database
GPG key ID: 644781002BDEA982
3 changed files with 19 additions and 2 deletions

2
Cargo.lock generated
View file

@ -224,7 +224,7 @@ checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1"
[[package]]
name = "forgejo-api-types"
version = "0.1.2"
version = "0.1.3"
dependencies = [
"chrono",
"clap",

View file

@ -1,6 +1,6 @@
[package]
name = "forgejo-api-types"
version = "0.1.2"
version = "0.1.3"
edition = "2021"
license = "AGPL-3.0-or-later"
keywords = ["forgejo", "types", "codeberg", "api"]

View file

@ -30,3 +30,20 @@ pub struct CreateRepoOption {
/// TrustModel of the repository.
pub trust_model: TrustModel,
}
impl Default for CreateRepoOption {
fn default() -> Self {
Self {
auto_init: AutoInit::Yes,
default_branch: String::from("main"),
description: String::from("An empty repository."),
gitignores: String::default(),
issue_labels: String::default(),
license: String::default(),
name: String::from("NewRepo"),
private: IsPrivate::Yes,
template: IsTemplate::No,
trust_model: TrustModel::Default,
}
}
}