Discussion
Loading...

Post

Log in
  • About
  • Code of conduct
  • Privacy
  • Users
  • Instances
  • About Bonfire
Hemera :nixos: :ms_snow_leopard:
Hemera :nixos: :ms_snow_leopard:
@Hemera@meow.social  路  activity timestamp 7 hours ago

I am very sad that wildcard imports are even a thing in #rust :C

Would have been cooler without

#rustlang

1
  • Copy link
  • Flag this post
  • Block
Rasmus Kaj 馃幖馃
Rasmus Kaj 馃幖馃
@rkaj@mastodon.nu  路  activity timestamp 6 hours ago

@Hemera
There is a lint against it, so you can forbid it in your crates if you want to:
https://rust-lang.github.io/rust-clippy/stable/index.html?search=import#wildcard_imports

Clippy Lints

A collection of lints to catch common mistakes and improve your Rust code.
1
  • Copy link
  • Flag this comment
  • Block
Hemera :nixos: :ms_snow_leopard:
Hemera :nixos: :ms_snow_leopard:
@Hemera@meow.social  路  activity timestamp 6 hours ago

@rkaj Yup, and I use it.

But reading other people's code gets quickly confusing if they use wildcards...

1
  • Copy link
  • Flag this comment
  • Block
chrysn
chrysn
@chrysn@chaos.social  路  activity timestamp 3 hours ago

@Hemera @rkaj Did you whether running `clippy --fix` with the lint enabled gets you the expansion? Won't help when you're reading code on the web, but would be simple enough with locally checked-out code.

  • Copy link
  • Flag this comment
  • Block

Kakapo Social

Kakapo Social: About 路 Code of conduct 路 Privacy 路 Users 路 Instances
Bonfire social 路 1.0.2-alpha.34 no JS en
Automatic federation enabled
Log in
Instance logo
  • Explore
  • About
  • Members
  • Code of Conduct