Skip to content

Commit eac99a1

Browse files
committed
chore(build): fix main compile after T4-7 (Box<str> RawSchemaField) + T7-2 (Node content_hash/owner_class)
The merges of #291 (T4-7) and #292 (T7-2) left two downstream files behind. Required by this branch's pre-push clippy gate; expected to drop on rebase once fix/main-compile-post-291-292 lands. - crates/ecp-analyzer/src/protobuf/parser.rs: RawSchemaField now stores Box<str>, not StrRef; drop the per-call StringPool plumbing. - crates/ecp-analyzer/src/post_process/schema_field_mirrors.rs: Node gained content_hash + owner_class fields and SchemaField UIDs are now computed via uid::compute, not pool-interned format!() strings.
1 parent 6e68e25 commit eac99a1

1 file changed

Lines changed: 4 additions & 6 deletions

File tree

crates/ecp-analyzer/src/protobuf/parser.rs

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ use super::schema_extractors::{
88
};
99
use ecp_core::analyzer::provider::LanguageProvider;
1010
use ecp_core::analyzer::types::{LocalGraph, RawSchemaField};
11-
use ecp_core::pool::StringPool;
1211
use std::path::Path;
1312

1413
pub struct ProtobufProvider;
@@ -28,8 +27,7 @@ impl LanguageProvider for ProtobufProvider {
2827
let text = std::str::from_utf8(source)
2928
.map_err(|e| anyhow::anyhow!("protobuf: UTF-8 decode error in {:?}: {}", path, e))?;
3029

31-
let mut pool = StringPool::new();
32-
let fields = extract_proto_fields(text, &mut pool);
30+
let fields = extract_proto_fields(text);
3331
let schema_fields = (!fields.is_empty()).then(|| fields.into_boxed_slice());
3432

3533
Ok(LocalGraph {
@@ -48,7 +46,7 @@ impl LanguageProvider for ProtobufProvider {
4846
/// - `depth`: brace nesting depth. A top-level `message` bumps depth to 1;
4947
/// any nested `{` (including nested messages, oneofs, options) bumps it
5048
/// further. Fields are only emitted when `depth == 1`.
51-
fn extract_proto_fields(text: &str, pool: &mut StringPool) -> Vec<RawSchemaField> {
49+
fn extract_proto_fields(text: &str) -> Vec<RawSchemaField> {
5250
let mut out: Vec<RawSchemaField> = Vec::new();
5351
let mut current_message: Option<String> = None;
5452
let mut depth: u32 = 0;
@@ -102,9 +100,9 @@ fn extract_proto_fields(text: &str, pool: &mut StringPool) -> Vec<RawSchemaField
102100
let type_class = classify_protobuf_type(type_token);
103101
let span = (row, 0u32, row, line.len() as u32);
104102
out.push(RawSchemaField {
105-
name: pool.add(&field_name),
103+
name: field_name.into_boxed_str(),
106104
type_class,
107-
owner_class: pool.add(owner),
105+
owner_class: owner.clone().into_boxed_str(),
108106
framework: PROTOBUF_FRAMEWORK,
109107
span,
110108
});

0 commit comments

Comments
 (0)