Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix compilation errors in get_link_by_id function #8

Closed
wants to merge 5 commits into from

Conversation

linksplatform-sweepai[bot]
Copy link
Contributor

Description

This PR fixes the compilation errors in the get_link_by_id function in the src/main.rs file. The errors were caused by the incorrect usage of the Link type and the placeholder _ in the function signature.

Summary of Changes

  • Imported the Link type from the doublets crate.
  • Replaced the placeholder _ in the function signature of get_link_by_id with a type parameter.

Please review and merge this PR. Thank you!

Fixes #7.


🎉 Latest improvements to Sweep:


💡 To get Sweep to edit this pull request, you can:

  • Leave a comment below to get Sweep to edit the entire PR
  • Leave a comment in the code will only modify the file
  • Edit the original issue to get Sweep to recreate the PR from scratch

@linksplatform-sweepai linksplatform-sweepai bot added the sweep Activate Sweep AI on issue label Sep 20, 2023
@linksplatform-sweepai linksplatform-sweepai bot mentioned this pull request Sep 20, 2023
1 task
src/main.rs Outdated
@@ -1,4 +1,4 @@
use doublets::{data::LinkType, mem, unit, Doublets, Error};
use doublets::{data::LinkType, mem, unit, Doublets, Error, Link};
Copy link
Member

Choose a reason for hiding this comment

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

There is no such type as Link use LinkType instead.

Copy link
Contributor Author

@linksplatform-sweepai linksplatform-sweepai bot Sep 20, 2023

Choose a reason for hiding this comment

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

Done.

@@ -1,4 +1,4 @@
use doublets::{data::LinkType, mem, unit, Doublets, Error};
use doublets::{data::LinkType, mem, unit, Doublets, Error, LinkType};
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
use doublets::{data::LinkType, mem, unit, Doublets, Error, LinkType};
use doublets::{data::LinkType, mem, unit, Doublets, Error};

Copy link
Contributor Author

@linksplatform-sweepai linksplatform-sweepai bot Sep 20, 2023

Choose a reason for hiding this comment

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

Done.

src/main.rs Outdated
@@ -67,7 +67,7 @@ fn nand(a: bool, b: bool) -> bool {
!(a && b)
}

fn get_link_by_id(store: &mut unit::Store<usize, _>, id: usize) -> Result<Link<usize>, Error<usize>> {
fn get_link_by_id<T>(store: &mut unit::Store<usize, T>, id: usize) -> Result<Link<usize>, Error<usize>> {
Copy link
Member

Choose a reason for hiding this comment

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

If you add a type parameter also update all usages of this function to be correct. Use LinkType instead of Link here.

Copy link
Contributor Author

@linksplatform-sweepai linksplatform-sweepai bot Sep 20, 2023

Choose a reason for hiding this comment

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

Done.

src/main.rs Outdated
Comment on lines 70 to 73
fn get_link_by_id<T>(store: &mut unit::Store<usize, T>, id: usize) -> Result<Link<T>, Error<usize>>
where
T: LinkType,
{
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
fn get_link_by_id<T>(store: &mut unit::Store<usize, T>, id: usize) -> Result<Link<T>, Error<usize>>
where
T: LinkType,
{
fn get_link_by_id<T: LinkType>(store: &mut impl Doublets<T>, id: usize) -> Result<Link<T>, Error<usize>>

Copy link
Contributor Author

@linksplatform-sweepai linksplatform-sweepai bot Sep 21, 2023

Choose a reason for hiding this comment

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

Done.

@linksplatform-sweepai linksplatform-sweepai bot deleted the sweep/fix-compilation-errors branch September 29, 2023 17:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
sweep Activate Sweep AI on issue
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Unable to compile
2 participants