@@ -1,5 +1,4 @@
|
|||||||
#![feature(io_error_more)]
|
#![feature(io_error_more)]
|
||||||
#![feature(const_option_ext)]
|
|
||||||
#![forbid(unsafe_code)]
|
#![forbid(unsafe_code)]
|
||||||
|
|
||||||
use std::path::Path;
|
use std::path::Path;
|
||||||
|
|||||||
@@ -9,8 +9,10 @@ use super::Project;
|
|||||||
use super::Provider;
|
use super::Provider;
|
||||||
|
|
||||||
const ACCEPT_HEADER_JSON: &str = "application/vnd.github.v3+json";
|
const ACCEPT_HEADER_JSON: &str = "application/vnd.github.v3+json";
|
||||||
const GITHUB_API_BASEURL: &str =
|
const GITHUB_API_BASEURL: &str = match option_env!("GITHUB_API_BASEURL") {
|
||||||
option_env!("GITHUB_API_BASEURL").unwrap_or("https://api.github.com");
|
Some(url) => url,
|
||||||
|
None => "https://api.github.com",
|
||||||
|
};
|
||||||
|
|
||||||
#[derive(Deserialize)]
|
#[derive(Deserialize)]
|
||||||
pub struct GithubProject {
|
pub struct GithubProject {
|
||||||
|
|||||||
@@ -9,7 +9,10 @@ use super::Project;
|
|||||||
use super::Provider;
|
use super::Provider;
|
||||||
|
|
||||||
const ACCEPT_HEADER_JSON: &str = "application/json";
|
const ACCEPT_HEADER_JSON: &str = "application/json";
|
||||||
const GITLAB_API_BASEURL: &str = option_env!("GITLAB_API_BASEURL").unwrap_or("https://gitlab.com");
|
const GITLAB_API_BASEURL: &str = match option_env!("GITLAB_API_BASEURL") {
|
||||||
|
Some(url) => url,
|
||||||
|
None => "https://gitlab.com",
|
||||||
|
};
|
||||||
|
|
||||||
#[derive(Deserialize)]
|
#[derive(Deserialize)]
|
||||||
#[serde(rename_all = "lowercase")]
|
#[serde(rename_all = "lowercase")]
|
||||||
|
|||||||
Reference in New Issue
Block a user