Skip to content

Commit

Permalink
Simplify
Browse files Browse the repository at this point in the history
  • Loading branch information
j178 committed Nov 23, 2024
1 parent 468727d commit 85072fb
Show file tree
Hide file tree
Showing 6 changed files with 0 additions and 26 deletions.
5 changes: 0 additions & 5 deletions src/languages/docker.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ use anyhow::Result;
use fancy_regex::Regex;
use tracing::trace;

use crate::config::Language;
use crate::fs::CWD;
use crate::hook::Hook;
use crate::languages::{LanguageImpl, DEFAULT_VERSION};
Expand Down Expand Up @@ -162,10 +161,6 @@ impl Docker {
}

impl LanguageImpl for Docker {
fn name(&self) -> Language {
Language::Docker
}

fn default_version(&self) -> &str {
DEFAULT_VERSION
}
Expand Down
5 changes: 0 additions & 5 deletions src/languages/fail.rs
Original file line number Diff line number Diff line change
@@ -1,17 +1,12 @@
use std::{collections::HashMap, sync::Arc};

use crate::config;
use crate::hook::Hook;
use crate::languages::{LanguageImpl, DEFAULT_VERSION};

#[derive(Debug, Copy, Clone)]
pub struct Fail;

impl LanguageImpl for Fail {
fn name(&self) -> config::Language {
config::Language::Fail
}

fn default_version(&self) -> &str {
DEFAULT_VERSION
}
Expand Down
1 change: 0 additions & 1 deletion src/languages/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ static DOCKER: docker::Docker = docker::Docker;
pub const DEFAULT_VERSION: &str = "default";

trait LanguageImpl {
fn name(&self) -> Language;
fn default_version(&self) -> &str;
fn environment_dir(&self) -> Option<&str>;
async fn install(&self, hook: &Hook) -> Result<()>;
Expand Down
5 changes: 0 additions & 5 deletions src/languages/node.rs
Original file line number Diff line number Diff line change
@@ -1,18 +1,13 @@
use std::collections::HashMap;
use std::sync::Arc;

use crate::config;
use crate::hook::Hook;
use crate::languages::{LanguageImpl, DEFAULT_VERSION};

#[derive(Debug, Copy, Clone)]
pub struct Node;

impl LanguageImpl for Node {
fn name(&self) -> config::Language {
config::Language::Node
}

fn default_version(&self) -> &str {
DEFAULT_VERSION
}
Expand Down
5 changes: 0 additions & 5 deletions src/languages/python/impl.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ use std::collections::HashMap;
use std::path::{Path, PathBuf};
use std::sync::Arc;

use crate::config;
use crate::hook::Hook;
use crate::languages::python::uv::ensure_uv;
use crate::languages::LanguageImpl;
Expand All @@ -13,10 +12,6 @@ use crate::run::run_by_batch;
pub struct Python;

impl LanguageImpl for Python {
fn name(&self) -> config::Language {
config::Language::Python
}

fn default_version(&self) -> &str {
// TODO find the version of python on the system
"python3"
Expand Down
5 changes: 0 additions & 5 deletions src/languages/system.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
use std::collections::HashMap;
use std::sync::Arc;

use crate::config;
use crate::hook::Hook;
use crate::languages::{LanguageImpl, DEFAULT_VERSION};
use crate::process::Cmd;
Expand All @@ -11,10 +10,6 @@ use crate::run::run_by_batch;
pub struct System;

impl LanguageImpl for System {
fn name(&self) -> config::Language {
config::Language::System
}

fn default_version(&self) -> &str {
DEFAULT_VERSION
}
Expand Down

0 comments on commit 85072fb

Please sign in to comment.