Skip to content

Commit

Permalink
fix lints
Browse files Browse the repository at this point in the history
  • Loading branch information
Milo123459 committed Jan 10, 2025
1 parent dbadb66 commit 9016ec0
Show file tree
Hide file tree
Showing 26 changed files with 27 additions and 32 deletions.
6 changes: 2 additions & 4 deletions src/nixpacks/environment.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,9 @@ impl Environment {
/// Collects all variables from the calling environment.
pub fn from_envs(envs: Vec<&str>) -> Result<Environment> {
let mut environment = Environment::default();
let r = Regex::new(r"([A-Za-z0-9_-]*)(?:=?)([\s\S]*)").unwrap();
for env in envs {
let matches = Regex::new(r"([A-Za-z0-9_-]*)(?:=?)([\s\S]*)")
.unwrap()
.captures(env)
.unwrap();
let matches = r.captures(env).unwrap();
if matches.get(2).unwrap().as_str() == "" {
// No value, pull from the current environment
let name = matches.get(1).unwrap().as_str();
Expand Down
2 changes: 1 addition & 1 deletion src/providers/clojure.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ const DEFAULT_JDK_PKG_NAME: &str = "jdk8";
pub struct ClojureProvider {}

impl Provider for ClojureProvider {
fn name(&self) -> &str {
fn name(&self) -> &'static str {
"clojure"
}

Expand Down
2 changes: 1 addition & 1 deletion src/providers/cobol.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ const DEFAULT_COBOL_COMPILE_ARGS: &str = "-x -o";
pub struct CobolProvider {}

impl Provider for CobolProvider {
fn name(&self) -> &str {
fn name(&self) -> &'static str {
"cobol"
}

Expand Down
2 changes: 1 addition & 1 deletion src/providers/crystal.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ pub struct ShardYaml {
pub struct CrystalProvider {}

impl Provider for CrystalProvider {
fn name(&self) -> &str {
fn name(&self) -> &'static str {
"crystal"
}

Expand Down
2 changes: 1 addition & 1 deletion src/providers/csharp.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ pub struct CSharpProvider {}
pub const ARTIFACT_DIR: &str = "out";

impl Provider for CSharpProvider {
fn name(&self) -> &str {
fn name(&self) -> &'static str {
"c#"
}

Expand Down
2 changes: 1 addition & 1 deletion src/providers/dart.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ pub struct DartPubspec {
pub struct DartProvider {}

impl Provider for DartProvider {
fn name(&self) -> &str {
fn name(&self) -> &'static str {
"dart"
}

Expand Down
2 changes: 1 addition & 1 deletion src/providers/deno.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ pub struct DenoJson {
pub struct DenoProvider {}

impl Provider for DenoProvider {
fn name(&self) -> &str {
fn name(&self) -> &'static str {
"deno"
}

Expand Down
2 changes: 1 addition & 1 deletion src/providers/elixir.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ const ELIXIR_NIXPKGS_ARCHIVE: &str = "c5702bd28cbde41a191a9c2a00501f18941efbd0";
pub struct ElixirProvider {}

impl Provider for ElixirProvider {
fn name(&self) -> &str {
fn name(&self) -> &'static str {
"elixir"
}

Expand Down
2 changes: 1 addition & 1 deletion src/providers/fsharp.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ pub struct FSharpProvider {}
pub const ARTIFACT_DIR: &str = "out";

impl Provider for FSharpProvider {
fn name(&self) -> &str {
fn name(&self) -> &'static str {
"f#"
}

Expand Down
2 changes: 1 addition & 1 deletion src/providers/gleam/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ impl GleamManifest {
pub struct GleamProvider;

impl Provider for GleamProvider {
fn name(&self) -> &str {
fn name(&self) -> &'static str {
"gleam"
}

Expand Down
2 changes: 1 addition & 1 deletion src/providers/go.rs
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ const DEFAULT_ARCHIVE: &str = "e89cf1c932006531f454de7d652163a9a5c86668";
const GO_BUILD_CACHE_DIR: &str = "/root/.cache/go-build";

impl Provider for GolangProvider {
fn name(&self) -> &str {
fn name(&self) -> &'static str {
"go"
}

Expand Down
2 changes: 1 addition & 1 deletion src/providers/haskell.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ const STACK_WORK_CACHE_DIR: &str = ".stack-work";
pub struct HaskellStackProvider {}

impl Provider for HaskellStackProvider {
fn name(&self) -> &str {
fn name(&self) -> &'static str {
"haskell"
}

Expand Down
2 changes: 1 addition & 1 deletion src/providers/java.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ const DEFAULT_GRADLE_VERSION: u32 = 8;
const JAVA_NIXPKGS_ARCHIVE: &str = "59dc10b5a6f2a592af36375c68fda41246794b86";

impl Provider for JavaProvider {
fn name(&self) -> &str {
fn name(&self) -> &'static str {
"java"
}

Expand Down
2 changes: 1 addition & 1 deletion src/providers/lunatic.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ use regex::Regex;
pub struct LunaticProvider {}

impl Provider for LunaticProvider {
fn name(&self) -> &str {
fn name(&self) -> &'static str {
"lunatic"
}

Expand Down
2 changes: 1 addition & 1 deletion src/providers/node/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ impl PackageJson {
pub struct NodeProvider {}

impl Provider for NodeProvider {
fn name(&self) -> &str {
fn name(&self) -> &'static str {
"node"
}

Expand Down
5 changes: 1 addition & 4 deletions src/providers/node/spa/vite.rs
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
use regex::Regex;

use crate::{
nixpacks::{app::App, environment::Environment},
providers::node::PackageJson,
};
use crate::{nixpacks::app::App, providers::node::PackageJson};

pub struct ViteSpaProvider {}

Expand Down
2 changes: 1 addition & 1 deletion src/providers/php/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ const PHP_ARCHIVE_VERSIONS: &[(&str, (&str, &str))] = &[
pub struct PhpProvider;

impl Provider for PhpProvider {
fn name(&self) -> &str {
fn name(&self) -> &'static str {
"php"
}

Expand Down
2 changes: 1 addition & 1 deletion src/providers/procfile.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ use anyhow::{Context, Ok, Result};
pub struct ProcfileProvider {}

impl Provider for ProcfileProvider {
fn name(&self) -> &str {
fn name(&self) -> &'static str {
"procfile"
}

Expand Down
2 changes: 1 addition & 1 deletion src/providers/python.rs
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ const LEGACY_PYTHON_NIXPKGS_ARCHIVE: &str = "5148520bfab61f99fd25fb9ff7bfbb50dad
pub struct PythonProvider {}

impl Provider for PythonProvider {
fn name(&self) -> &str {
fn name(&self) -> &'static str {
"python"
}

Expand Down
2 changes: 1 addition & 1 deletion src/providers/ruby.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ pub struct RubyProvider {}
const BUNDLE_CACHE_DIR: &str = "/root/.bundle/cache";

impl Provider for RubyProvider {
fn name(&self) -> &str {
fn name(&self) -> &'static str {
"ruby"
}

Expand Down
2 changes: 1 addition & 1 deletion src/providers/rust.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ const CARGO_TARGET_CACHE_DIR: &str = "target";
pub struct RustProvider {}

impl Provider for RustProvider {
fn name(&self) -> &str {
fn name(&self) -> &'static str {
"rust"
}

Expand Down
2 changes: 1 addition & 1 deletion src/providers/scala.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ const DEFAULT_JDK_VERSION: u32 = 17;
* TODO: Add support for scala-cli and mill
*/
impl Provider for ScalaProvider {
fn name(&self) -> &str {
fn name(&self) -> &'static str {
"scala"
}

Expand Down
2 changes: 1 addition & 1 deletion src/providers/scheme.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ use anyhow::Result;
pub struct HauntProvider {}

impl Provider for HauntProvider {
fn name(&self) -> &str {
fn name(&self) -> &'static str {
"scheme"
}

Expand Down
2 changes: 1 addition & 1 deletion src/providers/staticfile.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ pub struct Staticfile {
pub struct StaticfileProvider {}

impl Provider for StaticfileProvider {
fn name(&self) -> &str {
fn name(&self) -> &'static str {
"staticfile"
}

Expand Down
2 changes: 1 addition & 1 deletion src/providers/swift.rs
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ const AVAILABLE_SWIFT_VERSIONS: &[(&str, &str)] = &[
pub struct SwiftProvider {}

impl Provider for SwiftProvider {
fn name(&self) -> &str {
fn name(&self) -> &'static str {
"swift"
}

Expand Down
2 changes: 1 addition & 1 deletion src/providers/zig.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ use std::ffi::OsStr;
pub struct ZigProvider;

impl Provider for ZigProvider {
fn name(&self) -> &str {
fn name(&self) -> &'static str {
"zig"
}

Expand Down

0 comments on commit 9016ec0

Please sign in to comment.