linksplatform / Solver

Algorithms to find shortest and simplest possible functions for given input and output data ranges.
The Unlicense
2 stars 1 forks source link

Make get_link_by_id function #5

Closed Konard closed 1 year ago

Konard commented 1 year ago

This function should accept store and id arguments and return link

This function should use this example: https://github.com/linksplatform/Solver/blob/abd50f07fd04a2ba9498b2c158ead04f4880e686/src/main.rs#L86-L88

Hint: replace first any with an id argument.

Checklist - [X] `src/main.rs` ✅ Commit [`099c4d2`](https://github.com/linksplatform/Solver/commit/099c4d265f2327d7f6fa8253b38250b7924facd2)
• Add a new function `get_link_by_id` at the end of the file before the `#[cfg(test)]` line. The function should have the following signature: `fn get_link_by_id(store: &mut unit::Store, id: usize) -> Result, Error>`. • Inside the function, replace the first `any` with an `id` argument in the `each_iter` method call. The code should look like this: `store.each_iter([id, any, any]).for_each(|link| { println!("{link:?}"); });`.
linksplatform-sweepai[bot] commented 1 year ago

Here's the PR! https://github.com/linksplatform/Solver/pull/6.

💎 Sweep Pro: I used GPT-4 to create this ticket. You have unlimited GPT-4 tickets.

Actions (click)


Step 1: 🔎 Searching

I found the following snippets in your repository. I will now analyze these snippets and come up with a plan.

Some code snippets I looked at (click to expand). If some file is missing from here, you can mention the path in the ticket description. https://github.com/linksplatform/Solver/blob/abd50f07fd04a2ba9498b2c158ead04f4880e686/Cargo.toml#L1-L8 https://github.com/linksplatform/Solver/blob/abd50f07fd04a2ba9498b2c158ead04f4880e686/cargo-run-output.txt#L1-L14 https://github.com/linksplatform/Solver/blob/abd50f07fd04a2ba9498b2c158ead04f4880e686/rustfmt.toml#L1-L4 https://github.com/linksplatform/Solver/blob/abd50f07fd04a2ba9498b2c158ead04f4880e686/LICENSE#L1-L23 https://github.com/linksplatform/Solver/blob/abd50f07fd04a2ba9498b2c158ead04f4880e686/src/main.rs#L1-L103
I also found the following external resources that might be helpful: **Summaries of links found in the content:** https://github.com/linksplatform/Solver/blob/abd50f07fd04a2ba9498b2c158ead04f4880e686/src/main.rs#L86-L88: The page contains the source code of a Rust program. The relevant code snippet for the problem is located at lines 86-88 of the file `main.rs` in the GitHub repository `linksplatform/Solver`. The code snippet demonstrates an example usage of a function that accepts `store` and `id` arguments and returns a link. The function is called `all_seq_variants` and is defined in the file. The code snippet can be found at the following URL: [Solver/src/main.rs at abd50f07fd04a2ba9498b2c158ead04f4880e686](https://github.com/linksplatform/Solver/blob/abd50f07fd04a2ba9498b2c158ead04f4880e686/src/main.rs#L86-L88).

Step 2: ⌨️ Coding


Step 3: 🔁 Code Review

I have finished reviewing the code for completeness. I did not find errors for sweep/get_link_by_id_function.

.


🎉 Latest improvements to Sweep:


💡 To recreate the pull request edit the issue title or description. To tweak the pull request, leave a comment on the pull request. Join Our Discord