Skip to content

Commit

Permalink
Merge pull request #6 from notdijon/ups
Browse files Browse the repository at this point in the history
Remove associated type ICE workarounds fixed by rust-lang/rust#85499
  • Loading branch information
notdijon authored Oct 22, 2021
2 parents 48d3b34 + 0a32af6 commit 1b72806
Show file tree
Hide file tree
Showing 8 changed files with 28 additions and 621 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "hexavalent"
version = "0.1.6"
version = "0.1.7"
authors = ["notdijon <[email protected]>"]
license = "MIT"
description = "Write HexChat plugins in Rust."
Expand Down
3 changes: 1 addition & 2 deletions examples/simple.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ use std::cell::{Cell, RefCell};
use std::collections::HashSet;

use hexavalent::event::print::ChannelMessage;
use hexavalent::event::Event;
use hexavalent::hook::{Eat, Priority};
use hexavalent::{export_plugin, Plugin, PluginHandle};

Expand All @@ -16,7 +15,7 @@ impl SimplePlugin {
fn message_cb(
&self,
_ph: PluginHandle<'_, Self>,
[nick, _text, _mode, _ident]: <ChannelMessage as Event<'_>>::Args,
[nick, _text, _mode, _ident]: [&str; 4],
) -> Eat {
self.count.set(self.count.get() + 1);
self.nicks.borrow_mut().insert(nick.to_string());
Expand Down
7 changes: 1 addition & 6 deletions src/event/print.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,19 +30,14 @@ use crate::event::Event;
///
/// ```rust
/// use hexavalent::PluginHandle;
/// use hexavalent::event::Event;
/// use hexavalent::event::print::ChannelMessage;
/// use hexavalent::hook::{Eat, Priority};
///
/// fn hook_message<P: 'static>(ph: PluginHandle<'_, P>) {
/// ph.hook_print(ChannelMessage, Priority::Normal, message_cb);
/// }
///
/// fn message_cb<P>(
/// plugin: &P,
/// ph: PluginHandle<'_, P>,
/// args: <ChannelMessage as Event<'_>>::Args,
/// ) -> Eat {
/// fn message_cb<P>(plugin: &P, ph: PluginHandle<'_, P>, args: [&str; 4]) -> Eat {
/// let [nick, text, mode, ident] = args;
/// ph.print(&format!(
/// "Message from {} (with mode '{}', ident '{}'): {}\0",
Expand Down
7 changes: 1 addition & 6 deletions src/event/server.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,19 +15,14 @@ use crate::event::Event;
///
/// ```rust
/// use hexavalent::PluginHandle;
/// use hexavalent::event::Event;
/// use hexavalent::event::server::Privmsg;
/// use hexavalent::hook::{Eat, Priority};
///
/// fn hook_privmsg<P: 'static>(ph: PluginHandle<'_, P>) {
/// ph.hook_server(Privmsg, Priority::Normal, privmsg_cb);
/// }
///
/// fn privmsg_cb<P>(
/// plugin: &P,
/// ph: PluginHandle<'_, P>,
/// args: <Privmsg as Event<'_>>::Args,
/// ) -> Eat {
/// fn privmsg_cb<P>(plugin: &P, ph: PluginHandle<'_, P>, args: [&str; 4]) -> Eat {
/// let [sender, _, target, text] = args;
/// ph.print(&format!(
/// "Message from {} to {}: {}\0",
Expand Down
Loading

0 comments on commit 1b72806

Please sign in to comment.