Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor Binding and Prefix to use Rc for pointers #57

Open
wants to merge 80 commits into
base: master
Choose a base branch
from

Conversation

ahomescu
Copy link
Contributor

No description provided.

@ahomescu ahomescu added the enhancement New feature or request label Mar 25, 2020
@ahomescu ahomescu self-assigned this Mar 25, 2020
@ahomescu ahomescu changed the base branch from feature/cow_dtd to master May 1, 2020 00:07
Copy link
Contributor

@TheDan64 TheDan64 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good overall, just have a few thoughts

use std::rc::{Rc, Weak};
use std::slice;

type Ptr<T> = Option<Rc<T>>;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If I hadn't seen this alias, it wouldn't have been obvious what Ptr<T> is. OptRc<T> would be more obvious, but at that point it's not far off from Option<Rc<T>>. Is the full type that verbose that it warrants an alias?

src/lib/xmlparse.rs Outdated Show resolved Hide resolved
pub notation: Cell<*const XML_Char>,
pub open: Cell<XML_Bool>,
pub is_param: Cell<XML_Bool>,
pub is_internal: Cell<XML_Bool>,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I know that this simplifies a lot, but I keep wondering if it's becoming an anti-pattern if we have to use it absolutely everywhere

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants