Skip to content

Commit

Permalink
fix clippy errors
Browse files Browse the repository at this point in the history
  • Loading branch information
syphar committed May 3, 2024
1 parent 7c63657 commit cb1b1f3
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions crates/metadata/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -669,8 +669,8 @@ mod test_calculations {
assert_eq!(metadata.cargo_args(&[], &[]), default_cargo_args(&[]));
let env = metadata.environment_variables();
assert_eq!(env.get("DOCS_RS").map(String::as_str), Some("1"));
assert!(env.get("RUSTDOCFLAGS").is_none());
assert!(env.get("RUSTFLAGS").is_none());
assert!(!env.contains_key("RUSTDOCFLAGS"));
assert!(!env.contains_key("RUSTFLAGS"));
}

#[test]
Expand Down
8 changes: 4 additions & 4 deletions src/db/pool.rs
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ where
{
type Database = sqlx::Postgres;

fn fetch_many<'e, 'q: 'e, E: 'q>(
fn fetch_many<'e, 'q: 'e, E>(
self,
query: E,
) -> BoxStream<
Expand All @@ -196,17 +196,17 @@ where
>,
>
where
E: sqlx::Execute<'q, Self::Database>,
E: sqlx::Execute<'q, Self::Database> + 'q,
{
self.async_pool.fetch_many(query)
}

fn fetch_optional<'e, 'q: 'e, E: 'q>(
fn fetch_optional<'e, 'q: 'e, E>(
self,
query: E,
) -> BoxFuture<'e, Result<Option<<sqlx::Postgres as sqlx::Database>::Row>, sqlx::Error>>
where
E: sqlx::Execute<'q, Self::Database>,
E: sqlx::Execute<'q, Self::Database> + 'q,
{
self.async_pool.fetch_optional(query)
}
Expand Down
4 changes: 2 additions & 2 deletions src/web/rustdoc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -552,10 +552,10 @@ pub(crate) async fn rustdoc_html_server_handler(
let mut current_target = String::new();
let target_redirect = if latest_release.build_status.is_success() {
let target = if target.is_empty() {
current_target = krate.metadata.default_target.clone();
current_target.clone_from(&krate.metadata.default_target);
&krate.metadata.default_target
} else {
current_target = target.to_owned();
target.clone_into(&mut current_target);
target
};
format!("/target-redirect/{target}/{inner_path}")
Expand Down

0 comments on commit cb1b1f3

Please sign in to comment.