Skip to content

Commit

Permalink
Resolve bare_trait_objects warning
Browse files Browse the repository at this point in the history
    warning: trait objects without an explicit `dyn` are deprecated
      --> src/ignore.rs:48:12
       |
    48 |         Ok(Visitor::ignore())
       |            ^^^^^^^ help: use `dyn`: `<dyn Visitor>`
       |
       = note: `#[warn(bare_trait_objects)]` on by default
       = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in the 2021 edition!
       = note: for more information, see issue #80165 <rust-lang/rust#80165>

    warning: trait objects without an explicit `dyn` are deprecated
      --> src/ignore.rs:58:12
       |
    58 |         Ok(Visitor::ignore())
       |            ^^^^^^^ help: use `dyn`: `<dyn Visitor>`
       |
       = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in the 2021 edition!
       = note: for more information, see issue #80165 <rust-lang/rust#80165>
  • Loading branch information
dtolnay committed Jun 5, 2021
1 parent 5b99beb commit e695146
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/ignore.rs
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ impl Visitor for Ignore {

impl Seq for Ignore {
fn element(&mut self) -> Result<&mut dyn Visitor> {
Ok(Visitor::ignore())
Ok(<dyn Visitor>::ignore())
}

fn finish(&mut self) -> Result<()> {
Expand All @@ -55,7 +55,7 @@ impl Seq for Ignore {

impl Map for Ignore {
fn key(&mut self, _k: &str) -> Result<&mut dyn Visitor> {
Ok(Visitor::ignore())
Ok(<dyn Visitor>::ignore())
}

fn finish(&mut self) -> Result<()> {
Expand Down

0 comments on commit e695146

Please sign in to comment.