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

add Config for extensible configuration #37

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

programmerjake
Copy link
Member

Adds a extensible method for setting demangling configuration.

Using {:#} as the format string still works for both a less verbose method and for backwards compatibility by acting as if with_hash was set to false.

See also #36 (comment)

I also made some items pub(crate) instead of pub since they weren't externally visible

src/legacy.rs Outdated Show resolved Hide resolved
@eddyb

This comment has been minimized.

@programmerjake
Copy link
Member Author

Btw, if you add an fn display_with_config(self, Config) -> impl fmt::Display you could call .to_string() on that without this crate knowing about String.

That would be either demangle_with_config(mangled, config).to_string() or demangle(mangled).with_config(config).to_string().

@eddyb
Copy link
Member

eddyb commented Feb 3, 2020

Oops, I misremembered the fmt_with_config I suggested as public API, sorry.

@alexcrichton
Copy link
Member

Thanks for the PR! I'm sort of confused though as to what purpose this is serving? Is this fixing an immediate bug?

@programmerjake
Copy link
Member Author

Thanks for the PR! I'm sort of confused though as to what purpose this is serving? Is this fixing an immediate bug?

It's a new feature upon which more configuration options can be added, so it's not really a bug fix.

@alexcrichton
Copy link
Member

Ah ok, in that case I would prefer to not land this since we do not have a future feature in mind at this time. When that comes about I think it makes sense to design the scaffolding then to fit the feature, rather than trying to build the scaffolding now and hope the feature fits in the future.

@programmerjake
Copy link
Member Author

ok, seems reasonable

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

Successfully merging this pull request may close these issues.

3 participants