You've already forked authentication-service
mirror of
https://github.com/matrix-org/matrix-authentication-service.git
synced 2025-08-09 04:22:45 +03:00
Enable the clippy::str_to_string lint
This commit is contained in:
@@ -178,11 +178,11 @@ impl<B> MakeSpanBuilder<Request<B>> for SpanFromAxumRequest {
|
||||
}
|
||||
|
||||
let name = if let Some(path) = request.extensions().get::<MatchedPath>() {
|
||||
let path = path.as_str().to_string();
|
||||
let path = path.as_str().to_owned();
|
||||
attributes.push(HTTP_ROUTE.string(path.clone()));
|
||||
path
|
||||
} else {
|
||||
request.uri().path().to_string()
|
||||
request.uri().path().to_owned()
|
||||
};
|
||||
|
||||
SpanBuilder::from_name(name)
|
||||
@@ -196,7 +196,7 @@ pub struct SpanFromDnsRequest;
|
||||
|
||||
impl MakeSpanBuilder<Name> for SpanFromDnsRequest {
|
||||
fn make_span_builder(&self, request: &Name) -> SpanBuilder {
|
||||
let attributes = vec![NET_HOST_NAME.string(request.as_str().to_string())];
|
||||
let attributes = vec![NET_HOST_NAME.string(request.as_str().to_owned())];
|
||||
|
||||
SpanBuilder::from_name("resolve")
|
||||
.with_kind(SpanKind::Client)
|
||||
|
@@ -28,6 +28,6 @@ where
|
||||
{
|
||||
fn on_error(&self, span: &SpanRef<'_>, err: &E) {
|
||||
let attributes = vec![EXCEPTION_MESSAGE.string(err.to_string())];
|
||||
span.add_event("exception".to_string(), attributes);
|
||||
span.add_event("exception".to_owned(), attributes);
|
||||
}
|
||||
}
|
||||
|
@@ -17,6 +17,7 @@
|
||||
#![forbid(unsafe_code)]
|
||||
#![deny(
|
||||
clippy::all,
|
||||
clippy::str_to_string,
|
||||
rustdoc::missing_crate_level_docs,
|
||||
rustdoc::broken_intra_doc_links
|
||||
)]
|
||||
|
Reference in New Issue
Block a user