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.

The AI era means ongoing career reinvention. Join DEV.

It takes one minute and is worth it for your career.

Get started

Top comments (0)

A Workflow Copilot. Tailored to You.

Pieces.app image

Our desktop app, with its intelligent copilot, streamlines coding by generating snippets, extracting code from screenshots, and accelerating problem-solving.

Read the docs

👋 Kindness is contagious

Engage with a sea of insights in this enlightening article, highly esteemed within the encouraging DEV Community. Programmers of every skill level are invited to participate and enrich our shared knowledge.

A simple "thank you" can uplift someone's spirits. Express your appreciation in the comments section!

On DEV, sharing knowledge smooths our journey and strengthens our community bonds. Found this useful? A brief thank you to the author can mean a lot.

Okay