Skip to content

Update names of lib targets #163

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

Conversation

nicoburns
Copy link
Collaborator

@nicoburns nicoburns commented Mar 31, 2025

While the package names of the crates have all been updated to stylo*, it seems like that name of the crate within the package is still style* in some cases. This causes the docs.rs url to be https://docs.rs/stylo/latest/style rather than https://docs.rs/stylo/latest/stylo.

This PR changes this to be consistent by simply deleting the name = "..." lines which causes the crate name to default to the package name.

It also removes the crate_name attribute from the stylo_traits crate. These need to match the crate name in Cargo.toml. And as upstream have not yet renamed this crate keeping this line would mean extra diff. This line comes from the very first version of style_traits in 2015 (d7ba5ee) and none of the other crates have this attribute so I strongly suspect it is not necessary.

@@ -5,8 +5,6 @@
//! This module contains shared types and messages for use by devtools/script.
//! The traits are here instead of in script so that the devtools crate can be
//! modified independently of the rest of Servo.

#![crate_name = "style_traits"]
Copy link
Contributor

Choose a reason for hiding this comment

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

https://doc.rust-lang.org/rust-by-example/attribute/crate.html

it is important to note that both the crate_type and crate_name attributes have no effect whatsoever when using Cargo

So was this added in case that cargo is not used??

I'm a bit worried about accidentally breaking something that I'm missing.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

So was this added in case that cargo is not used??

I think so. See: https://web.mit.edu/rust-lang_v1.25/arch/amd64_ubuntu1404/share/doc/rust/html/rust-by-example/attribute/crate.html Given the timing of this code (when Cargo was still only a few months old), I suspect it may have been written with a pre-cargo world in mind.

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.

2 participants