Skip to content

feat: replace futures crate with futures-util#6

Merged
George-Miao merged 6 commits into
compio-rs:mainfrom
AsakuraMizu:feat/futures-util
Jan 7, 2026
Merged

feat: replace futures crate with futures-util#6
George-Miao merged 6 commits into
compio-rs:mainfrom
AsakuraMizu:feat/futures-util

Conversation

@AsakuraMizu
Copy link
Copy Markdown
Collaborator

No description provided.

@George-Miao
Copy link
Copy Markdown
Member

Hm, what's the difference?

@AsakuraMizu
Copy link
Copy Markdown
Collaborator Author

Hm, what's the difference?

Less dependencies, I think?

@Berrysoft
Copy link
Copy Markdown
Member

futures-util is smaller, I think.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR replaces the futures crate dependency with the more lightweight futures-util crate, which provides only the utility types and traits without the full executor and macro machinery.

Key changes:

  • Replaced futures dependency with futures-util in Cargo.toml
  • Updated all import paths from futures:: to futures_util:: in source files
  • Updated documentation references to reflect the new crate name
  • Modified doc examples in mutex module to use project-specific imports

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.

File Description
Cargo.toml Replaced futures with futures-util dependency and updated feature flags
src/waker_slot.rs Updated import paths and documentation to reference futures_util::task::AtomicWaker
src/mutex/mod.rs Updated import paths to futures_util::future::FusedFuture and modified doc examples to use synchrony:: instead of futures::lock

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread Cargo.toml Outdated
Comment thread Cargo.toml
@George-Miao
Copy link
Copy Markdown
Member

Actually, I think we can remove future-util dependency for mutex. We are only using FusedFuture, which is not necessary.

@AsakuraMizu
Copy link
Copy Markdown
Collaborator Author

We are only using FusedFuture, which is not necessary.

Do you suggest that they should move to futures-core?

By the way, there's something very strange: AtomicWaker is actually defined in futures-core, but it's been #[doc(hidden)] and then re-exported in futures-util.

George-Miao
George-Miao previously approved these changes Jan 6, 2026
Copy link
Copy Markdown
Member

@George-Miao George-Miao left a comment

Choose a reason for hiding this comment

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

LGTM

@George-Miao
Copy link
Copy Markdown
Member

@AsakuraMizu No, I mean we can completely get rid of futures in case of mutex

Copy link
Copy Markdown
Member

@George-Miao George-Miao left a comment

Choose a reason for hiding this comment

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

LGTM

@George-Miao George-Miao merged commit 43e1fa0 into compio-rs:main Jan 7, 2026
4 checks passed
@AsakuraMizu AsakuraMizu deleted the feat/futures-util branch January 7, 2026 08:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants