Skip to content

Remove UniqueId #48119

Description

@jdm

UniqueId uses unsafe code to implement a lazily-created value, but its only use is in code that already lazily creates it and immediately gets the value contained within it:

pub fn unique_id(&self) -> String {
let mut rare_data = self.ensure_rare_data();
if rare_data.unique_id.is_none() {
let id = UniqueId::new();
ScriptThread::save_node_id(id.borrow().to_simple().to_string());
rare_data.unique_id = Some(id);
}
rare_data
.unique_id
.as_ref()
.unwrap()
.borrow()
.to_simple()
.to_string()
}

We should remove the concept of UniqueId and just inline the relevant types in the unique_id field definition.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-content/domInteracting with the DOM from web contentE-less-complexStraightforward. Recommended for a new contributor.I-cleanupNo impact; the issue is one of maintainability or tidiness.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions