Skip to content

Sieve of Eratosthenes with linked list in Rust#8

Open
jtulach wants to merge 4 commits intomasterfrom
rust
Open

Sieve of Eratosthenes with linked list in Rust#8
jtulach wants to merge 4 commits intomasterfrom
rust

Conversation

@jtulach
Copy link
Copy Markdown
Owner

@jtulach jtulach commented Mar 25, 2022

Trying to re-implement the sieve.js in Rust.

rust/sieve.rs Outdated
break;
},
Some(n) => {
at = n;
Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

The compiler gives following error here:

sieve/rust$ rustc sieve.rs 
error[E0308]: mismatched types
  --> sieve.rs:61:26
   |
61 |                     at = n;
   |                          ^ types differ in mutability
   |
   = note: expected mutable reference `&mut Filter`
                      found reference `&Box<Filter>`

what's the right way to implement append to the end of linked list in Rust?

@jtulach jtulach force-pushed the master branch 2 times, most recently from 736a251 to d2e9fc8 Compare April 25, 2022 09:05
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.

1 participant