Skip to content

config refactor mar 26#2698

Open
tusharmath wants to merge 10 commits intomainfrom
config-refactor-mar-26
Open

config refactor mar 26#2698
tusharmath wants to merge 10 commits intomainfrom
config-refactor-mar-26

Conversation

@tusharmath
Copy link
Collaborator

  • refactor(config): adopt forge_config in domain and services
  • refactor(auth): remove auth logic and config fields

));

let config_repository = Arc::new(ForgeConfigRepository::new());
let config_repository = Arc::new(ForgeConfigRepository::new(infra.clone()));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Compilation Error: Parameter mismatch

This line calls ForgeConfigRepository::new(infra.clone()), passing an infra parameter. However, the new() method shown in forge_repo/src/app_config.rs (line 122) has the signature:

pub fn new() -> Self {
    Self { cache: Arc::new(Mutex::new(None)) }
}

The method does not accept any parameters, but this call is passing infra.clone(). This will fail to compile with an error like "this function takes 0 arguments but 1 argument was supplied".

Fix: Either update the ForgeConfigRepository::new() signature to accept the infra parameter:

pub fn new(infra: Arc<F>) -> Self {
    Self { cache: Arc::new(Mutex::new(None)), infra }
}

Or remove the parameter from this call if it's not needed:

let config_repository = Arc::new(ForgeConfigRepository::new());
Suggested change
let config_repository = Arc::new(ForgeConfigRepository::new(infra.clone()));
let config_repository = Arc::new(ForgeConfigRepository::new());

Spotted by Graphite

Fix in Graphite


Is this helpful? React 👍 or 👎 to let us know.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants