diff --git a/src/scm/driver/github/repo.rs b/src/scm/driver/github/repo.rs index c15a102..a3c4569 100644 --- a/src/scm/driver/github/repo.rs +++ b/src/scm/driver/github/repo.rs @@ -49,7 +49,7 @@ pub struct GithubRepository { pub default_branch: String, pub created_at: String, pub updated_at: String, - pub description: String, + pub description: Option, } #[derive(Debug, Deserialize, Serialize)] diff --git a/src/scm/driver/gitlab/repo.rs b/src/scm/driver/gitlab/repo.rs index 4cd392d..0cf2e3f 100644 --- a/src/scm/driver/gitlab/repo.rs +++ b/src/scm/driver/gitlab/repo.rs @@ -51,7 +51,7 @@ pub struct GitlabRepository { pub http_url: String, pub namespace: GitlabNamespace, pub created_at: String, - pub description: String, + pub description: Option, // pub updated_at: String, } diff --git a/src/scm/repo.rs b/src/scm/repo.rs index 7781571..627c32f 100644 --- a/src/scm/repo.rs +++ b/src/scm/repo.rs @@ -28,7 +28,7 @@ pub struct Repository { pub link: String, pub created: String, pub updated: String, - pub description: String, + pub description: Option, } /// Provides access to repository resources. diff --git a/tests/scm/driver/github/repo.rs b/tests/scm/driver/github/repo.rs index 960c7dd..c6738cb 100644 --- a/tests/scm/driver/github/repo.rs +++ b/tests/scm/driver/github/repo.rs @@ -21,7 +21,7 @@ use crate::common::mock; const REPO: &str = "octocat/Hello-World"; const REFERENCE: &str = "master"; -const DESCRIPTION: &str = "My first repository on GitHub!"; +const DESCRIPTION: Option<&str> = Some("My first repository on GitHub!"); #[test] fn test_find() { @@ -36,5 +36,8 @@ fn test_find() { let repo = result.unwrap().unwrap(); assert_eq!(repo.branch, REFERENCE.to_string()); - assert_eq!(repo.description, DESCRIPTION.to_string()); + assert_eq!( + repo.description.unwrap_or_default(), + DESCRIPTION.unwrap_or_default() + ); } diff --git a/tests/scm/driver/gitlab/repo.rs b/tests/scm/driver/gitlab/repo.rs index 1a9a574..72d8bfd 100644 --- a/tests/scm/driver/gitlab/repo.rs +++ b/tests/scm/driver/gitlab/repo.rs @@ -21,7 +21,7 @@ use crate::common::mock; const REPO: &str = "octocat/Hello-World"; const REFERENCE: &str = "master"; -const DESCRIPTION: &str = "Repository used by GitLab CE/EE and Gitaly tests"; +const DESCRIPTION: Option<&str> = Some("Repository used by GitLab CE/EE and Gitaly tests"); #[test] fn test_find() { @@ -36,5 +36,8 @@ fn test_find() { let repo = result.unwrap().unwrap(); assert_eq!(repo.branch, REFERENCE.to_string()); - assert_eq!(repo.description, DESCRIPTION.to_string()); + assert_eq!( + repo.description.unwrap_or_default(), + DESCRIPTION.unwrap_or_default() + ); }