Skip to content

Commit

Permalink
chore(formatting): Fixed formatting mistakes (#1126)
Browse files Browse the repository at this point in the history
fixed formatting mistakes have sneaked into prod

Co-authored-by: CommanderStorm <[email protected]>
  • Loading branch information
github-actions[bot] and CommanderStorm authored Apr 30, 2024
1 parent 0d26449 commit 7ee4348
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 10 deletions.
2 changes: 1 addition & 1 deletion server/main-api/src/calendar/fetch/connectum.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@ use std::{env, io};
use cached::instant::Instant;
use chrono::{DateTime, Utc};
use log::{debug, error, info, warn};
use oauth2::{AuthUrl, ClientId, ClientSecret, Scope, TokenResponse, TokenUrl};
use oauth2::basic::{BasicClient, BasicTokenResponse};
use oauth2::reqwest::async_http_client;
use oauth2::url::Url;
use oauth2::{AuthUrl, ClientId, ClientSecret, Scope, TokenResponse, TokenUrl};
use sqlx::PgPool;

use crate::calendar::fetch::CalendarEntryFetcher;
Expand Down
19 changes: 10 additions & 9 deletions server/main-api/src/feedback/github.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,14 @@ use log::error;
use octocrab::Octocrab;
use regex::Regex;

fn github_token() -> Result<String,()> {
match std::env::var("GITHUB_TOKEN"){
Ok(token)=> Ok(token.trim().to_string()),
Err(e)=>{
fn github_token() -> Result<String, ()> {
match std::env::var("GITHUB_TOKEN") {
Ok(token) => Ok(token.trim().to_string()),
Err(e) => {
format!("GITHUB_TOKEN has to be set for feedback: {e:?}");
Err(())
},
}
}

}

pub async fn open_issue(title: &str, description: &str, labels: Vec<String>) -> HttpResponse {
Expand All @@ -23,8 +22,10 @@ pub async fn open_issue(title: &str, description: &str, labels: Vec<String>) ->
.content_type("text/plain")
.body("Subject or body missing or too short");
}
let Ok(personal_token)=github_token() else {
return HttpResponse::InternalServerError().content_type("text/plain").body("Failed to create issue");
let Ok(personal_token) = github_token() else {
return HttpResponse::InternalServerError()
.content_type("text/plain")
.body("Failed to create issue");
};
let octocrab = match Octocrab::builder().personal_token(personal_token).build() {
Err(e) => {
Expand Down Expand Up @@ -61,7 +62,7 @@ pub async fn open_pr(
description: &str,
labels: Vec<String>,
) -> HttpResponse {
let Ok(personal_token)=github_token() else {
let Ok(personal_token) = github_token() else {
return HttpResponse::InternalServerError()
.content_type("text/plain")
.body("Failed to create a pull request");
Expand Down

0 comments on commit 7ee4348

Please sign in to comment.