Skip to content

Commit

Permalink
tc-cli: fix format issues
Browse files Browse the repository at this point in the history
  • Loading branch information
penumbra23 committed Feb 26, 2025
1 parent 9e3cbf7 commit 8fcfe02
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions tc-cli/src/slack.rs
Original file line number Diff line number Diff line change
Expand Up @@ -83,9 +83,9 @@ impl Slack {

// If thread isn't declared or empty, we should skip message sending
let thread = match std::env::var("SLACK_THREAD_TS") {
Ok(t) if t.is_empty()=> None,
Ok(t) if t.is_empty() => None,
Ok(t) => Some(SlackTs::new(t)),
Err(e) => return Err(e.into())
Err(e) => return Err(e.into()),
};
let client = SlackClient::new(SlackClientHyperConnector::new()?);
Ok(Self { client, token, channel, thread })
Expand All @@ -97,7 +97,6 @@ impl Slack {
msg: SlackMessageContent,
) -> Result<SlackTs> {
let session = self.client.open_session(&self.token);

// Skip sending if no thread is specified
if self.thread.is_none() {
return Ok(SlackTs::new(String::new()));
Expand All @@ -122,12 +121,10 @@ impl Slack {
content: Vec<u8>,
) -> Result<SlackFileId> {
let session = self.client.open_session(&self.token);

// Skip sending if no thread is specified
if self.thread.is_none() {
return Ok(SlackFileId::new(String::new()));
}

let req =
SlackApiFilesGetUploadUrlExternalRequest::new(format!("{name}.csv"), content.len());
let resp = session.get_upload_url_external(&req).await?;
Expand Down

0 comments on commit 8fcfe02

Please sign in to comment.