Skip to content

Commit 31a068f

Browse files
committed
fix silliness, delete nearly dead apis
1 parent 7df8266 commit 31a068f

File tree

3 files changed

+5
-14
lines changed

3 files changed

+5
-14
lines changed

turbopack/crates/turbo-tasks-backend/src/backend/mod.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ use turbo_tasks::{
3636
},
3737
event::{Event, EventListener},
3838
message_queue::TimingEvent,
39-
registry::get_value_type_global_name,
39+
registry::get_value_type,
4040
task_statistics::TaskStatisticsApi,
4141
trace::TraceRawVcs,
4242
turbo_tasks,
@@ -867,7 +867,7 @@ impl<B: BackingStorage> TurboTasksBackendInner<B> {
867867

868868
let _span = tracing::trace_span!(
869869
"recomputation",
870-
cell_type = get_value_type_global_name(cell.type_id),
870+
cell_type = get_value_type(cell.type_id).global_name,
871871
cell_index = cell.index
872872
)
873873
.entered();
@@ -3133,7 +3133,7 @@ impl DebugTraceTransientTask {
31333133
cell_type_id: Option<ValueTypeId>,
31343134
) -> fmt::Result {
31353135
if let Some(ty) = cell_type_id {
3136-
write!(f, " (read cell of type {})", get_value_type_global_name(ty))
3136+
write!(f, " (read cell of type {})", get_value_type(ty).global_name)
31373137
} else {
31383138
Ok(())
31393139
}

turbopack/crates/turbo-tasks/src/registry.rs

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,8 @@ static FUNCTIONS: Lazy<Functions> = Lazy::new(|| {
2828
for &native_function in functions.iter() {
2929
value_to_id.insert(native_function, id.into());
3030
let global_name = native_function.global_name;
31-
let new = names.insert(global_name);
3231
assert!(
33-
!new,
32+
names.insert(global_name),
3433
"multiple functions registered with name: {global_name}!"
3534
);
3635
id = id.checked_add(1).expect("overflowing function ids");
@@ -101,10 +100,6 @@ pub fn get_value_type(id: ValueTypeId) -> &'static ValueType {
101100
VALUES.id_to_value[*id as usize - 1]
102101
}
103102

104-
pub fn get_value_type_global_name(id: ValueTypeId) -> &'static str {
105-
get_value_type(id).global_name
106-
}
107-
108103
struct Traits {
109104
id_to_trait: Box<[&'static TraitType]>,
110105
trait_to_id: FxHashMap<&'static TraitType, TraitTypeId>,
@@ -149,7 +144,3 @@ pub fn get_trait_type_id(trait_type: &'static TraitType) -> TraitTypeId {
149144
pub fn get_trait(id: TraitTypeId) -> &'static TraitType {
150145
TRAITS.id_to_trait[*id as usize - 1]
151146
}
152-
153-
pub fn get_trait_type_global_name(id: TraitTypeId) -> &'static str {
154-
get_trait(id).global_name
155-
}

turbopack/crates/turbo-tasks/src/task/shared_reference.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ impl Serialize for TypedSharedReference {
116116
} else {
117117
Err(serde::ser::Error::custom(format!(
118118
"{:?} is not serializable",
119-
registry::get_value_type_global_name(*ty)
119+
registry::get_value_type(*ty).global_name
120120
)))
121121
}
122122
}

0 commit comments

Comments
 (0)