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

Conversation

@Xanewok
Copy link
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
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

src/analysis.rs Outdated
pub fn new() -> Analysis {
Analysis {
pub fn new() -> Self {
Self {
Copy link
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

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

Choose a reason for hiding this comment

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

ditto

src/lib.rs Outdated
pub fn new(target: Target) -> AnalysisHost {
AnalysisHost {
pub fn new(target: Target) -> Self {
Self {
Copy link
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...

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
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
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