Skip to content

Conversation

abr-egn
Copy link
Contributor

@abr-egn abr-egn commented Aug 23, 2022

No description provided.

@abr-egn abr-egn requested review from a team and isabelatkinson and removed request for a team August 23, 2022 18:14
@isabelatkinson
Copy link
Contributor

looks like there are still some clippy errors in CI. I think you've gotta run cargo update to see them locally, they're due to some new deprecations in chrono

@abr-egn
Copy link
Contributor Author

abr-egn commented Aug 24, 2022

Fixed the chrono deprecations - as a heads up, I was getting some confusing errors locally before I ran cargo update for serde-tests as well.

/// let big = bson::DateTime::from_millis(i64::MAX);
/// let chrono_big = big.to_chrono();
/// assert_eq!(chrono_big, chrono::MAX_DATETIME)
/// assert_eq!(chrono_big, chrono::DateTime::<chrono::Utc>::MAX_UTC)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Did chrono drop MAX_DATETIME? Or was this something clippy was complaining about?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Chrono deprecated MAX_DATETIME, yeah.

impl Borrow<RawDocument> for RawDocumentBuf {
fn borrow(&self) -> &RawDocument {
&*self
&**self
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is the extra deref needed here?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The error clippy made for this:

error: deref on an immutable reference
   --> src/raw/document_buf.rs:389:9
    |
389 |         &*self
    |         ^^^^^^
    |
    = note: `-D clippy::borrow-deref-ref` implied by `-D warnings`
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#borrow_deref_ref
help: if you would like to reborrow, try removing `&*`
    |
389 |         self
    |
help: if you would like to deref, try using `&**`
    |
389 |         &**self
    |

I've updated it to call .deref() directly for clarity.

@abr-egn abr-egn merged commit bad1468 into mongodb:main Sep 2, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants