DEV Community

Sean Atukorala
Sean Atukorala

Posted on

Solution for "error[E0425]: cannot find function `every` in module `time`" when using Iced Rust GUI library

Figure 1: Winter Scenery

Problem:
Running into the following error when trying to use the Iced GUI library for a Rust program that replicates the stopwatch Iced GUI example:

$ cargo build
error[E0425]: cannot find function `every` in module `time`
   --> src\main.rs:203:23
    |
203 |                 time::every(Duration::from_millis(10)).map(Message::Tick)
    |                       ^^^^^ not found in `time`
Enter fullscreen mode Exit fullscreen mode

Solution:
The problem was that the smol feature was not included in the features option for the iced dependency listed in the Cargo.toml file.

Try replacing your existing iced dependency line with the following line:

# Cargo.toml file

[dependencies]
iced = {version = "0.6", features = ["smol"]}
Enter fullscreen mode Exit fullscreen mode

Then run cargo build and see if the error is resolved!

Conclusion

Thanks for reading this blog post!

If you have any questions or concerns please feel free to post a comment in this post and I will get back to you if I find the time.

If you found this article helpful please share it and make sure to follow me on Twitter and GitHub, connect with me on LinkedIn and subscribe to my YouTube channel.

Do your career a big favor. Join DEV. (The website you're on right now)

It takes one minute, it's free, and is worth it for your career.

Get started

Community matters

Top comments (0)

AWS Security LIVE!

Tune in for AWS Security LIVE!

Join AWS Security LIVE! for expert insights and actionable tips to protect your organization and keep security teams prepared.

Learn More

👋 Kindness is contagious

Dive into an ocean of knowledge with this thought-provoking post, revered deeply within the supportive DEV Community. Developers of all levels are welcome to join and enhance our collective intelligence.

Saying a simple "thank you" can brighten someone's day. Share your gratitude in the comments below!

On DEV, sharing ideas eases our path and fortifies our community connections. Found this helpful? Sending a quick thanks to the author can be profoundly valued.

Okay