Skip to content

Commit f8aa85b

Browse files
committed
Fix clippy warnings
1 parent 96f2db9 commit f8aa85b

File tree

3 files changed

+8
-8
lines changed

3 files changed

+8
-8
lines changed

src/errors.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@ use crate::web::{NegotiatedContentType, Output};
1111
///
1212
/// Allows to handle application errors in the unified manner:
1313
///
14-
/// 1) all errors are serialized to the requested content type
15-
/// the HTTP status code is set accordingly
14+
/// 1) all errors are serialized to the requested content type the HTTP status
15+
/// code is set accordingly
1616
///
1717
/// 2) implements conversions from internal errors types (e.g. the errors
1818
/// returned by the Storage trait)

src/routes/snippets.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ fn create_snippet_impl(
2222
) -> Result<Created<Output<Snippet>>, ApiError> {
2323
let new_snippet = storage.create(snippet)?;
2424

25-
let location = vec![base_path.to_string(), new_snippet.id.to_string()].join("/");
25+
let location = [base_path.to_string(), new_snippet.id.to_string()].join("/");
2626
Ok(Created(location, Some(Output(new_snippet))))
2727
}
2828

@@ -80,7 +80,7 @@ fn create_link_header(
8080
.into_iter()
8181
.filter(|item| item.2)
8282
.map(|item| match item.0 {
83-
Some(query) => (vec![origin.path(), query.as_str()].join("?"), item.1),
83+
Some(query) => ([origin.path(), query.as_str()].join("?"), item.1),
8484
None => (origin.path().to_owned(), item.1),
8585
})
8686
.map(|item| format!("<{}>; rel=\"{}\"", item.0, item.1))
@@ -155,9 +155,9 @@ fn split_marker(mut snippets: Vec<Snippet>, limit: usize) -> (Option<String>, Ve
155155

156156
#[allow(clippy::too_many_arguments)]
157157
#[get("/snippets?<title>&<syntax>&<tag>&<marker>&<limit>")]
158-
pub fn list_snippets<'o, 'h>(
158+
pub fn list_snippets<'h>(
159159
storage: State<Box<dyn Storage>>,
160-
origin: &'o Origin,
160+
origin: &Origin,
161161
title: Option<String>,
162162
syntax: Option<String>,
163163
tag: Option<String>,

src/web.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@ mod auth;
22
mod content;
33
mod tracing;
44

5-
pub use crate::web::auth::{AuthValidator, BearerAuth, JwtValidator, User};
5+
pub use crate::web::auth::{AuthValidator, BearerAuth, JwtValidator};
66
pub use crate::web::content::{
77
DoNotAcceptAny, Input, NegotiatedContentType, Output, PaginationLimit, WithHttpHeaders,
88
};
9-
pub use crate::web::tracing::{RequestId, RequestIdHeader, RequestSpan};
9+
pub use crate::web::tracing::{RequestIdHeader, RequestSpan};

0 commit comments

Comments
 (0)