mirror of
https://github.com/servo/servo
synced 2026-05-14 19:06:31 +02:00
rename `WorkerGlobalScope.get_worker_id` to `WorkerGlobalScope.worker_id` Testing: This is a simple rename. No testing is necessary, since compiler will complain if something is wrong. Context: In https://github.com/servo/servo/pull/40156#discussion_r2462627713 I received feedback to use Rust getter name [convention](https://rust-lang.github.io/api-guidelines/naming.html#getter-names-follow-rust-convention-c-getter) and avoid adding `get_` methods. I initially chose `get_worker_name()` to match existing `get_worker_id()` below it. Overall I think it does make sense to rename `get_worker_id()` to `worker_id()`. `WorkerGlobalScope` has 2 more methods that start with `get_`: `get_cx(&self) -> JSContext` and `get_url`. `get_url` has a corresponding `set_url` as well in the same file. I am not sure if folks prefer to have those renamed as well or not, so I left those out of this PR, and instead started a discussion in a separate [issue](https://github.com/servo/servo/issues/40192) to figure out a consistent policy on Rust getter name convention in Servo codebase. Signed-off-by: Yerkebulan Tulibergenov <yerkebulan@gmail.com>