pub fn is_node_unused<S: BuildHasher>(
node_id: NodeId,
scope: UnusedScope,
graph: &CodeGraph,
reachable: Option<&HashSet<NodeId, S>>,
) -> boolExpand description
Check if a specific node is unused based on the scope filter.
A node is considered unused if:
- It matches the scope filter (All, Public, Private, Function, or Struct)
- It is not an entry point (main, test, or export)
- It is not reachable from any entry point
§Arguments
node_id- The node to checkscope- Filter for which types of nodes to checkgraph- The code graph to analyzereachable- Optional pre-computed reachable set (for efficiency when checking many nodes)
§Returns
true if the node is unused and matches the scope, false otherwise.
Returns false for invalid or non-existent nodes.