mirror of
https://github.com/fabro-sh/fabro.git
synced 2026-09-24 00:51:19 +00:00
fix: address clippy failures after main merge
This commit is contained in:
parent
e5714cd428
commit
3ae75e7698
2 changed files with 13 additions and 10 deletions
|
|
@ -504,6 +504,7 @@ mod tests {
|
|||
use fabro_llm::types::{
|
||||
ContentPart, FinishReason, Message as LlmMessage, Response, Role, TokenCounts, ToolCall,
|
||||
};
|
||||
use tokio::fs;
|
||||
use tokio_util::sync::CancellationToken;
|
||||
|
||||
use super::*;
|
||||
|
|
@ -901,7 +902,9 @@ mod tests {
|
|||
let dir = tempfile::tempdir().unwrap();
|
||||
let path = dir.path().join("src/lib.rs");
|
||||
std::fs::create_dir_all(path.parent().unwrap()).unwrap();
|
||||
std::fs::write(&path, "fn hello() {\n println!(\"old\");\n}\n").unwrap();
|
||||
fs::write(&path, "fn hello() {\n println!(\"old\");\n}\n")
|
||||
.await
|
||||
.unwrap();
|
||||
let env = LocalSandbox::new(dir.path().to_path_buf());
|
||||
let patch = "\
|
||||
*** Begin Patch
|
||||
|
|
@ -919,7 +922,7 @@ mod tests {
|
|||
"Success. Updated the following files:\nM src/lib.rs\n"
|
||||
);
|
||||
assert_eq!(
|
||||
std::fs::read_to_string(&path).unwrap(),
|
||||
fs::read_to_string(&path).await.unwrap(),
|
||||
"fn hello() {\n println!(\"new\");\n}\n"
|
||||
);
|
||||
}
|
||||
|
|
@ -1039,7 +1042,7 @@ mod tests {
|
|||
async fn pure_addition_update_hunk_uses_raw_local_file_text() {
|
||||
let dir = tempfile::tempdir().unwrap();
|
||||
let path = dir.path().join("insert_only.txt");
|
||||
std::fs::write(&path, "alpha\nomega\n").unwrap();
|
||||
fs::write(&path, "alpha\nomega\n").await.unwrap();
|
||||
let env = LocalSandbox::new(dir.path().to_path_buf());
|
||||
let patch = "\
|
||||
*** Begin Patch
|
||||
|
|
@ -1056,7 +1059,7 @@ mod tests {
|
|||
"Success. Updated the following files:\nM insert_only.txt\n"
|
||||
);
|
||||
assert_eq!(
|
||||
std::fs::read_to_string(&path).unwrap(),
|
||||
fs::read_to_string(&path).await.unwrap(),
|
||||
"alpha\nomega\ninserted\n"
|
||||
);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -206,6 +206,12 @@ impl DockerSandbox {
|
|||
}
|
||||
|
||||
async fn download_file_bytes(&self, remote_path: &str) -> crate::Result<Vec<u8>> {
|
||||
#[expect(
|
||||
clippy::disallowed_types,
|
||||
reason = "tar entries are synchronous in-memory readers; bytes are collected before any await"
|
||||
)]
|
||||
use std::io::Read as _;
|
||||
|
||||
let container_id = self.container_id()?;
|
||||
let container_path = self.resolve_container_path(remote_path);
|
||||
let opts = DownloadFromContainerOptions {
|
||||
|
|
@ -225,12 +231,6 @@ impl DockerSandbox {
|
|||
archive_bytes.extend_from_slice(&chunk);
|
||||
}
|
||||
|
||||
#[expect(
|
||||
clippy::disallowed_types,
|
||||
reason = "tar entries are synchronous in-memory readers; bytes are collected before any await"
|
||||
)]
|
||||
use std::io::Read as _;
|
||||
|
||||
let mut archive = tar::Archive::new(Cursor::new(archive_bytes));
|
||||
let entries = archive.entries().map_err(|e| {
|
||||
crate::Error::context(
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue