summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorCyborus <cyborus@cyborus.xyz>2024-04-26 18:12:39 +0200
committerCyborus <cyborus@cyborus.xyz>2024-04-26 18:12:39 +0200
commit5fda006b0f974d4ecf85ce850f144a18e79f2db7 (patch)
tree7442f559f87532faa1597fe16a85bb7a98a628f2 /src
parentMerge pull request 'update to Forgejo 7.0's API' (#46) from v7.0 into main (diff)
downloadforgejo-api-5fda006b0f974d4ecf85ce850f144a18e79f2db7.tar.xz
forgejo-api-5fda006b0f974d4ecf85ce850f144a18e79f2db7.zip
fix `repo_get_raw_file{_or_lfs}` not returning `Vec<u8>`
Diffstat (limited to 'src')
-rw-r--r--src/generated/methods.rs8
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())),
}
}