File tree Expand file tree Collapse file tree
crates/agent-gui/src-tauri/src/commands/app Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -320,9 +320,7 @@ fn classify_upload_text_bytes(bytes: &[u8], prefix_truncated: bool) -> UploadTex
320320 if bytes. contains ( & 0 ) {
321321 return UploadTextClass :: Binary ;
322322 }
323- let stripped = bytes
324- . strip_prefix ( & [ 0xEF , 0xBB , 0xBF ] )
325- . unwrap_or ( bytes) ;
323+ let stripped = bytes. strip_prefix ( & [ 0xEF , 0xBB , 0xBF ] ) . unwrap_or ( bytes) ;
326324 match std:: str:: from_utf8 ( stripped) {
327325 Ok ( _) => return UploadTextClass :: Utf8 ,
328326 Err ( error) => {
@@ -961,8 +959,7 @@ fn import_readable_file_paths_into_workdir(
961959 . unwrap_or ( "file" ) ;
962960 let sanitized_name = sanitize_uploaded_file_name ( source_name) ;
963961 let target = unique_path_for_copy ( import_root. join ( sanitized_name) ) ;
964- if detected. needs_utf8_transcode
965- && metadata. len ( ) <= UPLOADED_TEXT_TRANSCODE_MAX_BYTES
962+ if detected. needs_utf8_transcode && metadata. len ( ) <= UPLOADED_TEXT_TRANSCODE_MAX_BYTES
966963 {
967964 let bytes = fs:: read ( & source)
968965 . map_err ( |e| format ! ( "读取文件失败 {}: {e}" , source. display( ) ) ) ?;
You can’t perform that action at this time.
0 commit comments