From 9da230e5eedf00ff49f2ff2be0429667c5a61e9b Mon Sep 17 00:00:00 2001 From: Cyborus <87248184+Cyborus04@users.noreply.github.com> Date: Mon, 13 Nov 2023 17:22:23 -0500 Subject: [PATCH] methods do not need to take `&mut self` --- src/issue.rs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/issue.rs b/src/issue.rs index b930216..66c04ed 100644 --- a/src/issue.rs +++ b/src/issue.rs @@ -1,23 +1,23 @@ use super::*; impl Forgejo { - pub async fn get_repo_issues(&mut self, owner: &str, repo: &str, query: IssueQuery) -> Result, ForgejoError> { + pub async fn get_repo_issues(&self, owner: &str, repo: &str, query: IssueQuery) -> Result, ForgejoError> { self.get(&query.to_string(owner, repo)).await } - pub async fn create_issue(&mut self, owner: &str, repo: &str, opts: CreateIssueOption) -> Result { + pub async fn create_issue(&self, owner: &str, repo: &str, opts: CreateIssueOption) -> Result { self.post(&format!("/repos/{owner}/{repo}/issues"), &opts).await } - pub async fn get_issue(&mut self, owner: &str, repo: &str, id: u64) -> Result, ForgejoError> { + pub async fn get_issue(&self, owner: &str, repo: &str, id: u64) -> Result, ForgejoError> { self.get_opt(&format!("/repos/{owner}/{repo}/issues/{id}")).await } - pub async fn delete_issue(&mut self, owner: &str, repo: &str, id: u64) -> Result<(), ForgejoError> { + pub async fn delete_issue(&self, owner: &str, repo: &str, id: u64) -> Result<(), ForgejoError> { self.delete(&format!("/repos/{owner}/{repo}/issues/{id}")).await } - pub async fn edit_issue(&mut self, owner: &str, repo: &str, id: u64, opts: EditIssueOption) -> Result<(), ForgejoError> { + pub async fn edit_issue(&self, owner: &str, repo: &str, id: u64, opts: EditIssueOption) -> Result<(), ForgejoError> { self.patch(&format!("/repos/{owner}/{repo}/issues/{id}"), &opts).await } }