cargo clippy --fix

This commit is contained in:
R Tyler Croy 2023-02-05 16:27:05 -08:00
parent 1339c8c2e8
commit c02f87ae19
No known key found for this signature in database
GPG Key ID: E5C92681BEF6CEA2
4 changed files with 11 additions and 11 deletions

View File

@ -36,7 +36,7 @@ fn locate_on_path(bin: &str) -> Option<PathBuf> {
let full_path = path_dir.join(bin);
if full_path.is_file() {
// TODO: Should check to see if the path is executable
return Some(PathBuf::from(full_path));
return Some(full_path);
}
}
}
@ -46,7 +46,7 @@ fn locate_on_path(bin: &str) -> Option<PathBuf> {
/*
* Git capability will determine whether `git` exists on the system
*/
#[derive(Clone, Debug, PartialEq, Serialize)]
#[derive(Clone, Debug, PartialEq, Eq, Serialize)]
#[serde(tag = "name")]
pub struct Git {
path: PathBuf,
@ -65,7 +65,7 @@ impl Capability for Git {
}
}
#[derive(Clone, Debug, PartialEq, Serialize)]
#[derive(Clone, Debug, PartialEq, Eq, Serialize)]
#[serde(tag = "name")]
pub struct Cargo {
path: PathBuf,

View File

@ -4,7 +4,7 @@ use serde::{Deserialize, Serialize};
use url::Url;
use uuid::Uuid;
#[derive(Clone, Debug, Deserialize, Serialize, PartialEq)]
#[derive(Clone, Debug, Deserialize, Serialize, PartialEq, Eq)]
pub struct Capability {
pub name: String,
path: PathBuf,
@ -24,12 +24,12 @@ impl Capability {
#[derive(Clone, Debug, Deserialize, Serialize, PartialEq)]
struct CapsRequest {}
#[derive(Clone, Debug, Deserialize, Serialize, PartialEq)]
#[derive(Clone, Debug, Deserialize, Serialize, PartialEq, Eq)]
pub struct CapsResponse {
pub caps: Vec<Capability>,
}
#[derive(Clone, Debug, Deserialize, Serialize, PartialEq)]
#[derive(Clone, Debug, Deserialize, Serialize, PartialEq, Eq)]
pub struct Command {
pub script: String,
}
@ -42,12 +42,12 @@ impl Command {
}
}
#[derive(Clone, Debug, Deserialize, Serialize, PartialEq)]
#[derive(Clone, Debug, Deserialize, Serialize, PartialEq, Eq)]
pub struct CommandRequest {
pub commands: Vec<Command>,
}
#[derive(Clone, Debug, Deserialize, Serialize, PartialEq)]
#[derive(Clone, Debug, Deserialize, Serialize, PartialEq, Eq)]
pub struct CommandResponse {
pub uuid: Uuid,
pub stream: Option<Url>,

View File

@ -104,11 +104,11 @@ async fn main() -> Result<(), tide::Error> {
*/
for name in config.projects.keys() {
match Project::by_name(&name, &pool).await {
match Project::by_name(name, &pool).await {
Ok(_) => {}
Err(sqlx::Error::RowNotFound) => {
debug!("Project not found in database, creating: {}", name);
Project::create(&Project::new(&name), &pool).await?;
Project::create(&Project::new(name), &pool).await?;
}
Err(e) => {
return Err(e.into());

View File

@ -127,7 +127,7 @@ mod tests {
let mut run = Run::default();
run.project = project;
let _result = Run::create(&run, &pool).await.unwrap();
Run::create(&run, &pool).await.unwrap();
let fetched_run = Run::find_by(&run.run.uuid, &pool).await.unwrap();
assert_eq!(run.run.uuid, fetched_run.run.uuid);
}