Skip to content

Commit 45efd83

Browse files
fixup! simplify
1 parent 0ff33cf commit 45efd83

4 files changed

Lines changed: 25 additions & 308 deletions

File tree

AGENTS.md

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
## Test coding style preferences
2+
3+
- Prefer iterator chains over imperative loops in tests when equivalent (`for`, nested loops, and `if let` patterns can often be replaced with `flat_map`, `filter_map`, `collect`, `sum`, and `for_each`).
4+
- Avoid long `crate::...` paths in test bodies; import used types.
5+
- Import ordering should be: `std`, then dependencies, then `super`/`crate`.
6+
- Only group imports that are at the same level. For example:
7+
8+
```rust
9+
// bad
10+
use a::{b, c, e::f};
11+
12+
13+
// also bad
14+
use a::b;
15+
use a::c;
16+
use a::e::f;
17+
18+
// do this instead
19+
use a::{b, c};
20+
use a::e::f;
21+
22+
```
23+
- In test modules, prefer `use super::*` for items already imported in the module under test.
24+
- In tests, add explicit imports only for items not already used/imported by the module under test.

sentry-core/src/lib.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -164,5 +164,3 @@ pub use sentry_types::protocol::v7::{Breadcrumb, Envelope, Level, User};
164164
// utilities reused across integrations
165165
pub mod utils;
166166

167-
// telemtry types (limited to metrics for now)
168-
pub mod telemetry;

sentry-core/src/telemetry.rs

Lines changed: 0 additions & 304 deletions
This file was deleted.

sentry-core/tests/metrics.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,10 @@ use std::time::SystemTime;
77

88
use anyhow::{Context, Result};
99

10-
use sentry::protocol::{LogAttribute, MetricType, User};
10+
use sentry::protocol::{LogAttribute, Metric, MetricType, User};
1111
use sentry_core::protocol::{EnvelopeItem, ItemContainer, Value};
1212
use sentry_core::test;
1313
use sentry_core::{ClientOptions, Hub};
14-
use sentry_types::protocol::v7::Metric;
1514

1615
/// Test that metrics are sent when metrics are enabled.
1716
#[test]

0 commit comments

Comments
 (0)