Skip to content

Commit 663032e

Browse files
authored
test(tower): fix doctests (#888)
1 parent cd933d3 commit 663032e

File tree

4 files changed

+10
-5
lines changed

4 files changed

+10
-5
lines changed

Makefile

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,11 @@ lint:
3333
cargo +stable clippy --all-features --tests --examples -- -D clippy::all
3434
.PHONY: lint
3535

36+
fix:
37+
@rustup component add clippy --toolchain stable 2> /dev/null
38+
cargo +stable clippy --all-features --workspace --tests --examples --fix -- -D clippy::all
39+
.PHONY: fix
40+
3641
# Tests
3742

3843
test: checkall testall

sentry-backtrace/src/utils.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ pub fn filename(s: &str) -> &str {
5757
s.rsplit(&['/', '\\'][..]).next().unwrap()
5858
}
5959

60-
pub fn strip_symbol(s: &str) -> Cow<str> {
60+
pub fn strip_symbol(s: &str) -> Cow<'_, str> {
6161
let stripped_trailing_hash = HASH_FUNC_RE
6262
.captures(s)
6363
.map(|c| c.get(1).unwrap().as_str())

sentry-core/src/performance.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -757,7 +757,7 @@ impl Transaction {
757757
/// for as long as it lives. Therefore you must take care not to keep the returned
758758
/// `TransactionData` around too long or it will never relinquish the lock and you may run into
759759
/// a deadlock.
760-
pub fn data(&self) -> TransactionData {
760+
pub fn data(&self) -> TransactionData<'_> {
761761
TransactionData(self.inner.lock().unwrap())
762762
}
763763

@@ -988,7 +988,7 @@ impl Span {
988988
/// for as long as it lives. Therefore you must take care not to keep the returned
989989
/// `Data` around too long or it will never relinquish the lock and you may run into
990990
/// a deadlock.
991-
pub fn data(&self) -> Data {
991+
pub fn data(&self) -> Data<'_> {
992992
Data(self.span.lock().unwrap())
993993
}
994994

sentry-tower/src/lib.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -133,10 +133,10 @@
133133
//! When using `axum`, either use [`tower::ServiceBuilder`] as shown above, or make sure you
134134
//! reorder the layers, like so:
135135
//!
136-
//! ```rust
136+
//! ```ignore
137137
//! let app = Router::new()
138138
//! .route("/", get(handler))
139-
//! .layer(sentry_tower::SentryHttpLayer::with_transaction())
139+
//! .layer(sentry_tower::SentryHttpLayer::new().enable_transaction())
140140
//! .layer(sentry_tower::NewSentryLayer::<Request>::new_from_top())
141141
//! ```
142142
//!

0 commit comments

Comments
 (0)