Skip to content

Commit

Permalink
Merge pull request #48 from hubertshelley/perf/file_part
Browse files Browse the repository at this point in the history
perf(multipart): 保存文件方法调整
  • Loading branch information
hubertshelley authored Jun 16, 2024
2 parents 5d2466f + dd3cf3d commit cdcaedd
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion silent/src/core/form.rs
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ impl FilePart {
}
/// Save the file to a new location.
#[inline]
pub fn save(&mut self, path: String) -> Result<u64, SilentError> {
pub fn save(&self, path: String) -> Result<u64, SilentError> {
std::fs::copy(self.path(), Path::new(&path)).map_err(|e| SilentError::BusinessError {
code: StatusCode::INTERNAL_SERVER_ERROR,
msg: format!("Failed to save file: {}", e),
Expand Down

0 comments on commit cdcaedd

Please sign in to comment.