Skip to content
This repository was archived by the owner on Mar 1, 2019. It is now read-only.

Further simplify and explain crate id mapping#103

Merged
nrc merged 2 commits into
rust-dev-tools:masterfrom
Xanewok:further-tweaks
Oct 26, 2017
Merged

Further simplify and explain crate id mapping#103
nrc merged 2 commits into
rust-dev-tools:masterfrom
Xanewok:further-tweaks

Conversation

@Xanewok
Copy link
Copy Markdown
Contributor

@Xanewok Xanewok commented Oct 15, 2017

This addresses some Clippy lints, simplifies a bit, but most importantly, explains more the local -> global crate id mapping, which I couldn't understand at first. I hope this makes it a bit more easy to understand.

Copy link
Copy Markdown
Contributor

@nrc nrc 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 apart from one of the Clippy changes

Comment thread src/analysis.rs Outdated
pub fn new() -> Analysis {
Analysis {
pub fn new() -> Self {
Self {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I don't like this change - it adds an annoying level of indirection for the reader

Comment thread src/lib.rs Outdated
SymbolResult {
id: id,
fn new(id: Id, def: &Def) -> Self {
Self {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

ditto

Comment thread src/lib.rs Outdated
pub fn new(target: Target) -> AnalysisHost {
AnalysisHost {
pub fn new(target: Target) -> Self {
Self {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

and here and below...

Comment thread src/lib.rs
impl<L: AnalysisLoader> AnalysisHost<L> {
pub fn new_with_loader(l: L) -> AnalysisHost<L> {
AnalysisHost {
pub fn new_with_loader(loader: L) -> Self {
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Is this Self okay here? In case of generic types I think it is less noisy and quickly allows to see that the returned generic type is the same as ours

@Xanewok
Copy link
Copy Markdown
Contributor Author

Xanewok commented Oct 18, 2017

Updated, let me know if anything else also needs changing

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants