Random fixes

This commit is contained in:
Jonathan Turner
2019-09-01 09:19:59 +12:00
parent 70ebe899c6
commit 1a67ac6102
7 changed files with 79 additions and 56 deletions

View File

@ -22,7 +22,7 @@ pub trait Plugin {
#[allow(unused)]
fn sink(&mut self, call_info: CallInfo, input: Vec<Tagged<Value>>) {}
fn quit(&mut self) {}
fn quit(&mut self){}
}
pub fn serve_plugin(plugin: &mut dyn Plugin) {
@ -43,6 +43,7 @@ pub fn serve_plugin(plugin: &mut dyn Plugin) {
match command {
Ok(NuCommand::config) => {
send_response(plugin.config());
return;
}
Ok(NuCommand::begin_filter { params }) => {
send_response(plugin.begin_filter(params));
@ -52,6 +53,7 @@ pub fn serve_plugin(plugin: &mut dyn Plugin) {
}
Ok(NuCommand::end_filter) => {
send_response(plugin.end_filter());
return;
}
Ok(NuCommand::sink { params }) => {
@ -80,6 +82,7 @@ pub fn serve_plugin(plugin: &mut dyn Plugin) {
match command {
Ok(NuCommand::config) => {
send_response(plugin.config());
break;
}
Ok(NuCommand::begin_filter { params }) => {
send_response(plugin.begin_filter(params));
@ -89,6 +92,7 @@ pub fn serve_plugin(plugin: &mut dyn Plugin) {
}
Ok(NuCommand::end_filter) => {
send_response(plugin.end_filter());
break;
}
Ok(NuCommand::sink { params }) => {
plugin.sink(params.0, params.1);