Commit 84b26005 authored by Brad King's avatar Brad King
Browse files

types: make project readme_url optional

Projects with no readme have no such url.
parent f29c05b4
...@@ -366,7 +366,7 @@ fn test_read_project() { ...@@ -366,7 +366,7 @@ fn test_read_project() {
assert_eq!(project.web_url, assert_eq!(project.web_url,
"https://gitlab.kitware.com/utils/rust-gitlab"); "https://gitlab.kitware.com/utils/rust-gitlab");
assert_eq!(project.readme_url, assert_eq!(project.readme_url,
"https://gitlab.kitware.com/utils/rust-gitlab/blob/master/README.md"); Some("https://gitlab.kitware.com/utils/rust-gitlab/blob/master/README.md".to_string()));
assert!(project.owner.is_none()); assert!(project.owner.is_none());
assert_eq!(project.name, "rust-gitlab"); assert_eq!(project.name, "rust-gitlab");
assert_eq!(project.name_with_namespace, "Utils / rust-gitlab"); assert_eq!(project.name_with_namespace, "Utils / rust-gitlab");
......
...@@ -530,7 +530,7 @@ pub struct Project { ...@@ -530,7 +530,7 @@ pub struct Project {
/// The URL for the project's homepage. /// The URL for the project's homepage.
pub web_url: String, pub web_url: String,
/// The URL for the project's readme. /// The URL for the project's readme.
pub readme_url: String, pub readme_url: Option<String>,
/// The owner of the project (`None` for a group-owned project). /// The owner of the project (`None` for a group-owned project).
pub owner: Option<UserBasic>, pub owner: Option<UserBasic>,
/// The display name of the project. /// The display name of the project.
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment