Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: Update to use im 15.0.0 #254

Merged
merged 2 commits into from
Sep 9, 2020
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion sentry-core/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ test = ["client"]
sentry-types = { version = "0.19.1", path = "../sentry-types" }
serde = { version = "1.0.104", features = ["derive"] }
lazy_static = "1.4.0"
im = { version = "14.2.0", optional = true }
im = { version = "15.0.0", optional = true }
rand = { version = "0.7.3", optional = true }
serde_json = "1.0.46"
log_ = { package = "log", version = "0.4.8", optional = true, features = ["std"] }
Expand Down
8 changes: 4 additions & 4 deletions sentry-core/src/scope/real.rs
Original file line number Diff line number Diff line change
Expand Up @@ -234,10 +234,10 @@ impl Scope {
}
}

event.breadcrumbs.extend(self.breadcrumbs.iter().cloned());
event.extra.extend(self.extra.iter().cloned());
event.tags.extend(self.tags.iter().cloned());
event.contexts.extend(self.contexts.iter().cloned());
event.breadcrumbs.extend(self.breadcrumbs.clone().into_iter());
Copy link
Member

Choose a reason for hiding this comment

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

Just run rustfmt on this:

-        event.breadcrumbs.extend(self.breadcrumbs.clone().into_iter());
+        event
+            .breadcrumbs
+            .extend(self.breadcrumbs.clone().into_iter());

But can you explain why you need this? Is this an API change in im?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sure thing. (Sorry, I always forget to fmt)

Yeah, this looks to be a change required by im.
extend() changed from accepting a reference for a tuple to a tuple of references.

error[E0271]: type mismatch resolving `<im::hashmap::Iter<'_, std::string::String, sentry_types::protocol::v7::Context> as std::iter::Iterator>::Item == &_`
   --> sentry-core/src/scope/real.rs:243:52
    |
243 |         event.contexts.extend(self.contexts.iter().cloned());
    |                                                    ^^^^^^ expected tuple, found reference
    |
    = note:  expected tuple `(&std::string::String, &sentry_types::protocol::v7::Context)`
            found reference `&_`

event.extra.extend(self.extra.clone().into_iter());
event.tags.extend(self.tags.clone().into_iter());
event.contexts.extend(self.contexts.clone().into_iter());

if event.transaction.is_none() {
if let Some(ref txn) = self.transaction {
Expand Down