Skip to content

Commit

Permalink
[autofix.ci] apply automated fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
autofix-ci[bot] authored Aug 22, 2024
1 parent b43fc51 commit a2a791d
Showing 1 changed file with 12 additions and 9 deletions.
21 changes: 12 additions & 9 deletions ee/tabby-webserver/src/service/thread.rs
Original file line number Diff line number Diff line change
Expand Up @@ -157,15 +157,18 @@ impl ThreadService for ThreadServiceImpl {
message: &CreateMessageInput,
) -> Result<()> {
let thread_id = thread_id.as_rowid()?;
let client_code = message.attachments.as_ref().map(|x| {
let code = x.code.iter().map(Into::into).collect::<Vec<_>>();
// If there are no code attachments, return None
if code.is_empty() {
None
} else {
Some(code)
}
}).flatten();
let client_code = message
.attachments
.as_ref()
.and_then(|x| {
let code = x.code.iter().map(Into::into).collect::<Vec<_>>();
// If there are no code attachments, return None
if code.is_empty() {
None
} else {
Some(code)
}
});

self.db
.create_thread_message(
Expand Down

0 comments on commit a2a791d

Please sign in to comment.