Fix warnings for Rust 1.51 (#3214)

* Fix warnings for Rust 1.51

* More fixes

* More fixes
This commit is contained in:
Jonathan Turner
2021-03-26 21:26:57 +13:00
committed by GitHub
parent 589fc0b8ad
commit 7e184b58b2
55 changed files with 325 additions and 400 deletions

View File

@ -6,14 +6,14 @@ use nu_source::{SpannedItem, Tag};
use std::str::FromStr;
#[derive(Default)]
pub struct FromBSON {
pub struct FromBson {
pub state: Vec<u8>,
pub name_tag: Tag,
}
impl FromBSON {
pub fn new() -> FromBSON {
FromBSON {
impl FromBson {
pub fn new() -> FromBson {
FromBson {
state: vec![],
name_tag: Tag::unknown(),
}

View File

@ -1,4 +1,4 @@
mod from_bson;
mod nu;
pub use from_bson::FromBSON;
pub use from_bson::FromBson;

View File

@ -1,6 +1,6 @@
use nu_plugin::serve_plugin;
use nu_plugin_from_bson::FromBSON;
use nu_plugin_from_bson::FromBson;
fn main() {
serve_plugin(&mut FromBSON::new())
serve_plugin(&mut FromBson::new())
}

View File

@ -1,13 +1,13 @@
#[cfg(test)]
mod tests;
use crate::FromBSON;
use crate::FromBson;
use nu_errors::ShellError;
use nu_plugin::Plugin;
use nu_protocol::{CallInfo, Primitive, ReturnValue, Signature, UntaggedValue, Value};
use nu_source::Tag;
impl Plugin for FromBSON {
impl Plugin for FromBson {
fn config(&mut self) -> Result<Signature, ShellError> {
Ok(Signature::build("from bson")
.desc("Convert from .bson binary into table")