Remove the old it-hacks from fetch and post (#1807)

This commit is contained in:
Jonathan Turner
2020-05-16 11:18:46 -07:00
committed by GitHub
parent f43ed23ed7
commit 48d06f40b1
5 changed files with 12 additions and 57 deletions

View File

@ -1,7 +1,7 @@
use futures::executor::block_on;
use nu_errors::ShellError;
use nu_plugin::Plugin;
use nu_protocol::{CallInfo, ReturnValue, Signature, SyntaxShape, Value};
use nu_protocol::{CallInfo, ReturnValue, Signature, SyntaxShape};
use crate::post::post_helper;
use crate::Post;
@ -46,10 +46,6 @@ impl Plugin for Post {
fn begin_filter(&mut self, call_info: CallInfo) -> Result<Vec<ReturnValue>, ShellError> {
self.setup(call_info)?;
Ok(vec![])
}
fn filter(&mut self, row: Value) -> Result<Vec<ReturnValue>, ShellError> {
Ok(vec![block_on(post_helper(
&self.path.clone().ok_or_else(|| {
ShellError::labeled_error("expected a 'path'", "expected a 'path'", &self.tag)
@ -61,7 +57,6 @@ impl Plugin for Post {
self.user.clone(),
self.password.clone(),
&self.headers.clone(),
row,
))])
}
}