Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/dispatcher/builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,9 @@ impl DispatcherBuilder {
#[cfg(not(target_arch = "wasm32"))]
pub fn proxy<S>(mut self, proxy: S) -> Self
where
S: Into<String>,
S: Into<Option<String>>,
{
self.proxy = Some(proxy.into());
self.proxy = proxy.into();
self
}

Expand Down
26 changes: 14 additions & 12 deletions src/payload/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -53,19 +53,20 @@ impl Payload {
#[inline]
pub fn title<S>(mut self, title: S) -> Self
where
S: Into<String>,
S: Into<Option<String>>,
{
self.title = Some(title.into());
self.title = title.into();
self
}

/// Set tags
pub fn tags<I, S>(mut self, tags: I) -> Self
pub fn tags<I, S, P>(mut self, tags: P) -> Self
where
I: IntoIterator<Item = S>,
S: Into<String>,
P: Into<Option<I>>,
{
self.tags = Some(tags.into_iter().map(|t| t.into()).collect());
self.tags = tags.into().map(|i| i.into_iter().map(Into::into).collect());
self
}

Expand All @@ -77,11 +78,12 @@ impl Payload {
}

/// Set actions
pub fn actions<I>(mut self, actions: I) -> Self
pub fn actions<I, P>(mut self, actions: P) -> Self
where
I: IntoIterator<Item = Action>,
P: Into<Option<I>>,
{
self.actions = Some(actions.into_iter().collect());
self.actions = actions.into().map(|i| i.into_iter().collect());
self
}

Expand All @@ -103,29 +105,29 @@ impl Payload {
#[inline]
pub fn filename<S>(mut self, filename: S) -> Self
where
S: Into<String>,
S: Into<Option<String>>,
{
self.filename = Some(filename.into());
self.filename = filename.into();
self
}

/// Set delay
#[inline]
pub fn delay<S>(mut self, delay: S) -> Self
where
S: Into<String>,
S: Into<Option<String>>,
{
self.delay = Some(delay.into());
self.delay = delay.into();
self
}

/// Set email
#[inline]
pub fn email<S>(mut self, email: S) -> Self
where
S: Into<String>,
S: Into<Option<String>>,
{
self.email = Some(email.into());
self.email = email.into();
self
}

Expand Down
Loading