diff options
author | Cyborus <cyborus@cyborus.xyz> | 2024-04-26 18:12:39 +0200 |
---|---|---|
committer | Cyborus <cyborus@cyborus.xyz> | 2024-04-26 18:12:39 +0200 |
commit | 5fda006b0f974d4ecf85ce850f144a18e79f2db7 (patch) | |
tree | 7442f559f87532faa1597fe16a85bb7a98a628f2 /src/generated | |
parent | Merge pull request 'update to Forgejo 7.0's API' (#46) from v7.0 into main (diff) | |
download | forgejo-api-5fda006b0f974d4ecf85ce850f144a18e79f2db7.tar.xz forgejo-api-5fda006b0f974d4ecf85ce850f144a18e79f2db7.zip |
fix `repo_get_raw_file{_or_lfs}` not returning `Vec<u8>`
Diffstat (limited to 'src/generated')
-rw-r--r-- | src/generated/methods.rs | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/generated/methods.rs b/src/generated/methods.rs index 9cc914f..c2404c9 100644 --- a/src/generated/methods.rs +++ b/src/generated/methods.rs @@ -4309,13 +4309,13 @@ impl crate::Forgejo { repo: &str, filepath: &str, query: RepoGetRawFileOrLfsQuery, - ) -> Result<(), ForgejoError> { + ) -> Result<Vec<u8>, ForgejoError> { let request = self .get(&format!("repos/{owner}/{repo}/media/{filepath}?{query}")) .build()?; let response = self.execute(request).await?; match response.status().as_u16() { - 200 => Ok(()), + 200 => Ok(response.bytes().await?[..].to_vec()), _ => Err(ForgejoError::UnexpectedStatusCode(response.status())), } } @@ -5235,13 +5235,13 @@ impl crate::Forgejo { repo: &str, filepath: &str, query: RepoGetRawFileQuery, - ) -> Result<(), ForgejoError> { + ) -> Result<Vec<u8>, ForgejoError> { let request = self .get(&format!("repos/{owner}/{repo}/raw/{filepath}?{query}")) .build()?; let response = self.execute(request).await?; match response.status().as_u16() { - 200 => Ok(()), + 200 => Ok(response.bytes().await?[..].to_vec()), _ => Err(ForgejoError::UnexpectedStatusCode(response.status())), } } |