diff options
| author | nsfisis <nsfisis@gmail.com> | 2026-06-24 04:51:47 +0900 |
|---|---|---|
| committer | nsfisis <nsfisis@gmail.com> | 2026-06-24 05:02:54 +0900 |
| commit | a8623a5e867825400073d2597dfb3118d6624ef7 (patch) | |
| tree | 7df29f68596765dc3914209e14af4999b721815f /crates/shirabe/src/repository/vcs | |
| parent | e87d37a294a4c754585309d391d793a2c9a1287e (diff) | |
| download | php-shirabe-a8623a5e867825400073d2597dfb3118d6624ef7.tar.gz php-shirabe-a8623a5e867825400073d2597dfb3118d6624ef7.tar.zst php-shirabe-a8623a5e867825400073d2597dfb3118d6624ef7.zip | |
chore: unwrap meaningless PhpMixed::String()
Diffstat (limited to 'crates/shirabe/src/repository/vcs')
| -rw-r--r-- | crates/shirabe/src/repository/vcs/git_bitbucket_driver.rs | 64 | ||||
| -rw-r--r-- | crates/shirabe/src/repository/vcs/github_driver.rs | 16 | ||||
| -rw-r--r-- | crates/shirabe/src/repository/vcs/gitlab_driver.rs | 10 |
3 files changed, 43 insertions, 47 deletions
diff --git a/crates/shirabe/src/repository/vcs/git_bitbucket_driver.rs b/crates/shirabe/src/repository/vcs/git_bitbucket_driver.rs index fb450d8..b5469ec 100644 --- a/crates/shirabe/src/repository/vcs/git_bitbucket_driver.rs +++ b/crates/shirabe/src/repository/vcs/git_bitbucket_driver.rs @@ -95,7 +95,7 @@ impl GitBitbucketDriver { return Err(InvalidArgumentException { message: format!( "The Bitbucket repository URL {} is invalid. It must be the HTTPS URL of a Bitbucket repository.", - PhpMixed::String(self.inner.url.clone()), + self.inner.url.clone(), ), code: 0, } @@ -154,9 +154,9 @@ impl GitBitbucketDriver { fn get_repo_data(&mut self) -> Result<bool> { let resource = format!( "https://api.bitbucket.org/2.0/repositories/{}/{}?{}", - PhpMixed::String(self.owner.clone()), - PhpMixed::String(self.repository.clone()), - PhpMixed::String(http_build_query_mixed( + self.owner.clone(), + self.repository.clone(), + http_build_query_mixed( &{ let mut m: IndexMap<String, PhpMixed> = IndexMap::new(); m.insert( @@ -167,7 +167,7 @@ impl GitBitbucketDriver { }, "", "&", - )), + ), ); let repo_data = self @@ -349,9 +349,9 @@ impl GitBitbucketDriver { "source".to_string(), PhpMixed::String(format!( "https://{}/{}/{}/src", - PhpMixed::String(self.inner.origin_url.clone()), - PhpMixed::String(self.owner.clone()), - PhpMixed::String(self.repository.clone()), + self.inner.origin_url.clone(), + self.owner.clone(), + self.repository.clone(), )), ); } @@ -360,11 +360,11 @@ impl GitBitbucketDriver { "source".to_string(), PhpMixed::String(format!( "https://{}/{}/{}/src/{}/?at={}", - PhpMixed::String(self.inner.origin_url.clone()), - PhpMixed::String(self.owner.clone()), - PhpMixed::String(self.repository.clone()), - PhpMixed::String(hash.unwrap()), - PhpMixed::String(label.clone()), + self.inner.origin_url.clone(), + self.owner.clone(), + self.repository.clone(), + hash.unwrap(), + label.clone(), )), ); } @@ -385,9 +385,9 @@ impl GitBitbucketDriver { "issues".to_string(), PhpMixed::String(format!( "https://{}/{}/{}/issues", - PhpMixed::String(self.inner.origin_url.clone()), - PhpMixed::String(self.owner.clone()), - PhpMixed::String(self.repository.clone()), + self.inner.origin_url.clone(), + self.owner.clone(), + self.repository.clone(), )), ); } @@ -429,10 +429,10 @@ impl GitBitbucketDriver { let resource = format!( "https://api.bitbucket.org/2.0/repositories/{}/{}/src/{}/{}", - PhpMixed::String(self.owner.clone()), - PhpMixed::String(self.repository.clone()), - PhpMixed::String(identifier), - PhpMixed::String(file.to_string()), + self.owner.clone(), + self.repository.clone(), + identifier, + file.to_string(), ); Ok(self @@ -457,9 +457,9 @@ impl GitBitbucketDriver { let resource = format!( "https://api.bitbucket.org/2.0/repositories/{}/{}/commit/{}?fields=date", - PhpMixed::String(self.owner.clone()), - PhpMixed::String(self.repository.clone()), - PhpMixed::String(identifier), + self.owner.clone(), + self.repository.clone(), + identifier, ); let commit = self .fetch_with_oauth_credentials(&resource, false)? @@ -498,9 +498,9 @@ impl GitBitbucketDriver { let url = format!( "https://bitbucket.org/{}/{}/get/{}.zip", - PhpMixed::String(self.owner.clone()), - PhpMixed::String(self.repository.clone()), - PhpMixed::String(identifier.to_string()), + self.owner.clone(), + self.repository.clone(), + identifier.to_string(), ); let mut m: IndexMap<String, String> = IndexMap::new(); @@ -521,8 +521,8 @@ impl GitBitbucketDriver { let mut tags: IndexMap<String, String> = IndexMap::new(); let mut resource = format!( "{}?{}", - PhpMixed::String(self.tags_url.clone()), - PhpMixed::String(http_build_query_mixed( + self.tags_url.clone(), + http_build_query_mixed( &{ let mut m: IndexMap<String, PhpMixed> = IndexMap::new(); m.insert("pagelen".to_string(), PhpMixed::Int(100)); @@ -538,7 +538,7 @@ impl GitBitbucketDriver { }, "", "&", - )), + ), ); let mut has_next = true; while has_next { @@ -600,8 +600,8 @@ impl GitBitbucketDriver { let mut branches: IndexMap<String, String> = IndexMap::new(); let mut resource = format!( "{}?{}", - PhpMixed::String(self.branches_url.clone()), - PhpMixed::String(http_build_query_mixed( + self.branches_url.clone(), + http_build_query_mixed( &{ let mut m: IndexMap<String, PhpMixed> = IndexMap::new(); m.insert("pagelen".to_string(), PhpMixed::Int(100)); @@ -619,7 +619,7 @@ impl GitBitbucketDriver { }, "", "&", - )), + ), ); let mut has_next = true; while has_next { diff --git a/crates/shirabe/src/repository/vcs/github_driver.rs b/crates/shirabe/src/repository/vcs/github_driver.rs index e9956a9..bea7294 100644 --- a/crates/shirabe/src/repository/vcs/github_driver.rs +++ b/crates/shirabe/src/repository/vcs/github_driver.rs @@ -82,7 +82,7 @@ impl GitHubDriver { return Err(InvalidArgumentException { message: format!( "The GitHub repository URL {} is invalid.", - PhpMixed::String(self.inner.url.clone()), + self.inner.url.clone(), ), code: 0, } @@ -364,10 +364,10 @@ impl GitHubDriver { "source".to_string(), PhpMixed::String(format!( "https://{}/{}/{}/tree/{}", - PhpMixed::String(self.inner.origin_url.clone()), - PhpMixed::String(self.owner.clone()), - PhpMixed::String(self.repository.clone()), - PhpMixed::String(label_str), + self.inner.origin_url.clone(), + self.owner.clone(), + self.repository.clone(), + label_str, )), ); } @@ -388,9 +388,9 @@ impl GitHubDriver { "issues".to_string(), PhpMixed::String(format!( "https://{}/{}/{}/issues", - PhpMixed::String(self.inner.origin_url.clone()), - PhpMixed::String(self.owner.clone()), - PhpMixed::String(self.repository.clone()), + self.inner.origin_url.clone(), + self.owner.clone(), + self.repository.clone(), )), ); } diff --git a/crates/shirabe/src/repository/vcs/gitlab_driver.rs b/crates/shirabe/src/repository/vcs/gitlab_driver.rs index e0fb72e..f1f361e 100644 --- a/crates/shirabe/src/repository/vcs/gitlab_driver.rs +++ b/crates/shirabe/src/repository/vcs/gitlab_driver.rs @@ -88,7 +88,7 @@ impl GitLabDriver { return Err(InvalidArgumentException { message: format!( "The GitLab repository URL {} is invalid. It must be the HTTP URL of a GitLab project.", - PhpMixed::String(self.inner.url.clone()), + self.inner.url.clone(), ), code: 0, } @@ -357,11 +357,7 @@ impl GitLabDriver { }) { support.insert( "source".to_string(), - PhpMixed::String(format!( - "{}/-/tree/{}", - PhpMixed::String(web_url), - PhpMixed::String(label_str), - )), + PhpMixed::String(format!("{}/-/tree/{}", web_url, label_str)), ); } } @@ -388,7 +384,7 @@ impl GitLabDriver { }) { support.insert( "issues".to_string(), - PhpMixed::String(format!("{}/-/issues", PhpMixed::String(web_url),)), + PhpMixed::String(format!("{}/-/issues", PhpMixed::String(web_url))), ); } } |
