Commit d59ed6f0 authored by Robert Czechowski's avatar Robert Czechowski

Remove clippy warnings

parent b814db3d
......@@ -20,13 +20,13 @@ format: src/db_conn_postgres.rs
cargo +nightly fmt
clippy: src/db_conn_postgres.rs
cargo clippy --all-targets --features 'complete debug' -- -D warnings -A clippy::type-complexity -A clippy::option-map-unit-fn -A clippy::len-zero -A clippy::option-as-ref-deref -A clippy::or-fun-call -A clippy::comparison-to-empty -A clippy::result-unit-err -A clippy::unnecessary-wraps -A clippy::vec-init-then-push
cargo clippy --all-targets --features 'complete debug' -- -D warnings -A clippy::type-complexity -A clippy::option-map-unit-fn -A clippy::len-zero -A clippy::option-as-ref-deref -A clippy::or-fun-call -A clippy::comparison-to-empty -A clippy::result-unit-err -A clippy::unnecessary-wraps -A clippy::vec-init-then-push -A clippy::needless-borrow
src/db_conn_postgres.rs: src/db_conn_warning_header.txt src/db_conn_sqlite_new.header.rs src/db_conn_postgres.header.rs src/db_conn.base.rs
tools/generate_connectors.sh
doc: src/db_conn_postgres.rs
cargo doc --no-deps
cargo doc --no-deps
echo '<meta http-equiv="refresh" content="0; url=medal">' > target/doc/index.html
grcov: src/db_conn_postgres.rs
......
......@@ -814,16 +814,12 @@ pub fn show_task<T: MedalConnection>(conn: &T, task_id: i32, session_token: &str
}
let (template, tasklocation) = match t.location.chars().next() {
Some('B') => {
("wtask".to_owned(), &t.location[1..])
},
Some('B') => ("wtask".to_owned(), &t.location[1..]),
Some('P') => {
data.insert("tasklang".to_string(), to_json(&"python"));
("wtask".to_owned(), &t.location[1..])
},
_ => {
("task".to_owned(), &t.location as &str)
},
}
_ => ("task".to_owned(), &t.location as &str),
};
let taskpath = format!("{}{}", c.location, &tasklocation);
......
......@@ -27,7 +27,7 @@ pub enum SignupResult {
/// This trait abstracts the database connection and provides function for all actions to be performed on the database
/// in the medal platform.
pub trait MedalConnection {
fn reconnect(&config::Config) -> Self;
fn reconnect(config: &config::Config) -> Self;
fn dbtype(&self) -> &'static str;
......
......@@ -36,7 +36,7 @@ trait Queryable {
fn exists(&self, sql: &str, params: &[&dyn postgres::types::ToSql]) -> bool;
fn get_last_id(&self) -> Option<i32>;
fn reconnect_concrete(&config::Config) -> Self;
fn reconnect_concrete(config: &config::Config) -> Self;
}
impl Queryable for Connection {
......
......@@ -49,7 +49,7 @@ trait Queryable {
fn exists(&self, sql: &str, params: &[&dyn postgres::types::ToSql]) -> bool;
fn get_last_id(&self) -> Option<i32>;
fn reconnect_concrete(&config::Config) -> Self;
fn reconnect_concrete(config: &config::Config) -> Self;
}
impl Queryable for Connection {
......
......@@ -36,7 +36,7 @@ trait Queryable {
fn exists(&self, sql: &str, params: &[&dyn rusqlite::types::ToSql]) -> bool;
fn get_last_id(&self) -> Option<i32>;
fn reconnect_concrete(&config::Config) -> Self;
fn reconnect_concrete(config: &config::Config) -> Self;
}
impl Queryable for Connection {
......
......@@ -49,7 +49,7 @@ trait Queryable {
fn exists(&self, sql: &str, params: &[&dyn rusqlite::types::ToSql]) -> bool;
fn get_last_id(&self) -> Option<i32>;
fn reconnect_concrete(&config::Config) -> Self;
fn reconnect_concrete(config: &config::Config) -> Self;
}
impl Queryable for Connection {
......
......@@ -66,7 +66,7 @@ pub fn verify_password(password: &str, salt: &str, password_hash: &str) -> bool
}
pub trait SetPassword {
fn set_password(&mut self, &str) -> Option<()>;
fn set_password(&mut self, password: &str) -> Option<()>;
}
impl SetPassword for SessionUser {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment