erikgrinaker / toydb

Distributed SQL database in Rust, written as a learning project
Apache License 2.0
5.99k stars 555 forks source link

Fix lint warning #49

Closed chenyukang closed 2 years ago

erikgrinaker commented 2 years ago

Thank you! Looks like there's still a linter warning though:

warning: an implementation of `From` is preferred since it gives you `Into<_>` for free where the reverse isn't true
  --> src/sql/types/mod.rs:57:1
   |
57 | impl<'a> Into<Cow<'a, Value>> for Value {
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   |
note: the lint level is defined here
  --> src/lib.rs:1:9
   |
1  | #![warn(clippy::all)]
   |         ^^^^^^^^^^^
   = note: `#[warn(clippy::from_over_into)]` implied by `#[warn(clippy::all)]`
   = help: consider to implement `From<sql::types::Value>` instead
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#from_over_into

warning: an implementation of `From` is preferred since it gives you `Into<_>` for free where the reverse isn't true
  --> src/sql/types/mod.rs:63:1
   |
63 | impl<'a> Into<Cow<'a, Value>> for &'a Value {
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   |
   = help: consider to implement `From<&'a sql::types::Value>` instead
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#from_over_into

warning: 2 warnings emitted
erikgrinaker commented 2 years ago

Awesome, thank you!

chenyukang commented 2 years ago

Fixed it. Thanks @erikgrinaker , it's an awesome project to learn database internals and Rust.