mirror of
https://github.com/System-End/slack-morphism-rust.git
synced 2026-04-19 22:05:15 +00:00
Restrict SlackHeaderBlock to accept plan text only block (#273)
* Restrict SlackHeaderBlock to accept plan text only block * Fix new cargo clippy warnings
This commit is contained in:
parent
e1ab878f7b
commit
b03c088742
6 changed files with 20 additions and 7 deletions
|
|
@ -87,10 +87,7 @@ pub struct SlackApiFilesUploadResponse {
|
|||
pub file: SlackFile,
|
||||
}
|
||||
|
||||
fn to_csv<S: Serializer>(x: &Option<Vec<SlackChannelId>>, s: S) -> Result<S::Ok, S::Error>
|
||||
where
|
||||
S: Serializer,
|
||||
{
|
||||
fn to_csv<S: Serializer>(x: &Option<Vec<SlackChannelId>>, s: S) -> Result<S::Ok, S::Error> {
|
||||
match x {
|
||||
None => s.serialize_none(),
|
||||
Some(ids) => {
|
||||
|
|
|
|||
|
|
@ -13,6 +13,7 @@ pub enum SlackDateTimeFormats {
|
|||
TimeSecs,
|
||||
}
|
||||
|
||||
#[allow(clippy::to_string_trait_impl)]
|
||||
impl ToString for SlackDateTimeFormats {
|
||||
fn to_string(&self) -> String {
|
||||
match self {
|
||||
|
|
|
|||
|
|
@ -56,7 +56,7 @@ impl From<SlackSectionBlock> for SlackBlock {
|
|||
#[derive(Debug, PartialEq, Clone, Serialize, Deserialize, Builder)]
|
||||
pub struct SlackHeaderBlock {
|
||||
pub block_id: Option<SlackBlockId>,
|
||||
pub text: SlackBlockText,
|
||||
pub text: SlackBlockPlainTextOnly,
|
||||
}
|
||||
|
||||
impl From<SlackHeaderBlock> for SlackBlock {
|
||||
|
|
@ -874,8 +874,8 @@ impl From<SlackBlockCheckboxesElement> for SlackActionBlockElement {
|
|||
}
|
||||
|
||||
/**
|
||||
* 'plain_text' type of https://api.slack.com/reference/block-kit/composition-objects#text
|
||||
*/
|
||||
* 'plain_text' type of https://api.slack.com/reference/block-kit/composition-objects#text
|
||||
*/
|
||||
#[skip_serializing_none]
|
||||
#[derive(Debug, PartialEq, Clone, Serialize, Deserialize, Builder)]
|
||||
pub struct SlackBlockPlainText {
|
||||
|
|
|
|||
|
|
@ -9,23 +9,35 @@ use std::*;
|
|||
use url::Url;
|
||||
|
||||
mod user;
|
||||
|
||||
pub use user::*;
|
||||
|
||||
mod team;
|
||||
|
||||
pub use team::*;
|
||||
|
||||
mod channel;
|
||||
|
||||
pub use channel::*;
|
||||
|
||||
mod reaction;
|
||||
|
||||
pub use reaction::*;
|
||||
|
||||
mod star;
|
||||
|
||||
pub use star::*;
|
||||
|
||||
mod bot;
|
||||
|
||||
pub use bot::*;
|
||||
|
||||
mod icon;
|
||||
|
||||
pub use icon::*;
|
||||
|
||||
mod formatters;
|
||||
|
||||
pub use formatters::*;
|
||||
|
||||
#[derive(Debug, Eq, PartialEq, Hash, Clone, Serialize, Deserialize, ValueStruct)]
|
||||
|
|
@ -178,6 +190,7 @@ pub enum SlackConversationType {
|
|||
Public,
|
||||
}
|
||||
|
||||
#[allow(clippy::to_string_trait_impl)]
|
||||
impl ToString for SlackConversationType {
|
||||
fn to_string(&self) -> String {
|
||||
match self {
|
||||
|
|
|
|||
|
|
@ -24,6 +24,7 @@ impl SlackSocketModeWssClientId {
|
|||
}
|
||||
}
|
||||
|
||||
#[allow(clippy::to_string_trait_impl)]
|
||||
impl ToString for SlackSocketModeWssClientId {
|
||||
fn to_string(&self) -> String {
|
||||
format!(
|
||||
|
|
|
|||
|
|
@ -24,6 +24,7 @@ pub enum SlackApiTokenType {
|
|||
App,
|
||||
}
|
||||
|
||||
#[allow(clippy::to_string_trait_impl)]
|
||||
impl ToString for SlackApiTokenType {
|
||||
fn to_string(&self) -> String {
|
||||
match self {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue