mirror of
https://github.com/MindWorkAI/AI-Studio.git
synced 2025-05-03 09:39:47 +00:00
Refactored file extension extraction to use next_back for improved reliability
This commit is contained in:
parent
221b7d44ac
commit
3df1989238
@ -79,7 +79,7 @@ async fn stream_data(file_path: &str) -> Result<ChunkStream> {
|
||||
FileFormat::from_file(&file_path_clone)
|
||||
}).await??;
|
||||
|
||||
let ext = file_path.split('.').last().unwrap_or("");
|
||||
let ext = file_path.split('.').next_back().unwrap_or("");
|
||||
let stream = match ext {
|
||||
DOCX | ODT => {
|
||||
let from = if ext == DOCX { "docx" } else { "odt" };
|
||||
|
Loading…
Reference in New Issue
Block a user