mirror of
https://github.com/slint-ui/slint.git
synced 2025-08-04 10:50:00 +00:00
Clean up internal Exports struct
- Use deref instead of `.0` tuple access (looks neater) - Provide a convenience find() function that also makes use of the sorting
This commit is contained in:
parent
6f19ab38e7
commit
b38fe7c5f0
5 changed files with 13 additions and 18 deletions
|
@ -10,7 +10,7 @@ use crate::object_tree::{Component, Document, PropertyVisibility};
|
|||
|
||||
pub fn check_public_api(doc: &Document, diag: &mut BuildDiagnostics) {
|
||||
check_public_api_component(&doc.root_component, diag);
|
||||
for (export_name, e) in &doc.exports.0 {
|
||||
for (export_name, e) in &*doc.exports {
|
||||
if let Some(c) = e.as_ref().left() {
|
||||
if c.is_global() {
|
||||
// This global will become part of the public API.
|
||||
|
|
|
@ -16,7 +16,7 @@ pub fn collect_globals(doc: &Document, _diag: &mut BuildDiagnostics) {
|
|||
doc.root_component.used_types.borrow_mut().globals.clear();
|
||||
let mut set = HashSet::new();
|
||||
let mut sorted_globals = vec![];
|
||||
for (_, ty) in &doc.exports.0 {
|
||||
for (_, ty) in &*doc.exports {
|
||||
if let Some(c) = ty.as_ref().left() {
|
||||
if c.is_global() {
|
||||
if set.insert(ByAddress(c.clone())) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue