From 1a65a163a145d8a370a3c84990d6360843989b83 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hannes=20K=C3=B6rber?= Date: Mon, 13 Jun 2022 22:47:49 +0200 Subject: [PATCH] Use opaque type for auth token So we cannot accidentially output it, as it does not implement `Display`. --- src/auth.rs | 1 - src/provider/github.rs | 2 +- src/provider/gitlab.rs | 2 +- 3 files changed, 2 insertions(+), 3 deletions(-) diff --git a/src/auth.rs b/src/auth.rs index 7c1490b..5ab5119 100644 --- a/src/auth.rs +++ b/src/auth.rs @@ -7,7 +7,6 @@ impl AuthToken { pub fn access(&self) -> &str { &self.0 } - } pub fn get_token_from_command(command: &str) -> Result { diff --git a/src/provider/github.rs b/src/provider/github.rs index 42a75cf..094b860 100644 --- a/src/provider/github.rs +++ b/src/provider/github.rs @@ -1,12 +1,12 @@ use serde::Deserialize; +use super::auth; use super::escape; use super::ApiErrorResponse; use super::Filter; use super::JsonError; use super::Project; use super::Provider; -use super::auth; const PROVIDER_NAME: &str = "github"; const ACCEPT_HEADER_JSON: &str = "application/vnd.github.v3+json"; diff --git a/src/provider/gitlab.rs b/src/provider/gitlab.rs index 2dc2132..fc4b216 100644 --- a/src/provider/gitlab.rs +++ b/src/provider/gitlab.rs @@ -1,12 +1,12 @@ use serde::Deserialize; +use super::auth; use super::escape; use super::ApiErrorResponse; use super::Filter; use super::JsonError; use super::Project; use super::Provider; -use super::auth; const PROVIDER_NAME: &str = "gitlab"; const ACCEPT_HEADER_JSON: &str = "application/json";