1
0
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:
Quentin Gliech
2022-08-05 10:18:32 +02:00
parent 78fe152d9b
commit c1ed726dc8
39 changed files with 120 additions and 81 deletions

View File

@@ -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)

View File

@@ -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);
}
}

View File

@@ -17,6 +17,7 @@
#![forbid(unsafe_code)]
#![deny(
clippy::all,
clippy::str_to_string,
rustdoc::missing_crate_level_docs,
rustdoc::broken_intra_doc_links
)]