Giter Site home page Giter Site logo

Comments (11)

regexident avatar regexident commented on June 21, 2024

Hi Ewan,

would you by chance be able to provide a minimal(!) reproducible main.rs file along with the actual, as well as expected output? I'm not exactly sure what you mean, so some real code would help greatly. 🙂

from cargo-modules.

ejmount avatar ejmount commented on June 21, 2024

Given a file like this, with appropriate Cargo.toml

struct AThing;

pub mod alpha {
    use delta::ATrait;
    pub mod beta {
        use crate::AThing;
        use chrono::DateTime;

        pub struct AnotherThing {
            dt: chrono::Duration,
        }

        pub mod gamma {

            use rand::CryptoRng;
        }
    }
    pub mod delta {
        use super::beta::AnotherThing;
        use rand::Rng;

        pub trait ATrait {}


    }

}

And running cargo modules generate graph --with-types --with-uses --with-traits --layout dot | dot -Tpng -O, I get this:
noname gv

When what I actually want is something like this:
layout dot

In particular I want to keep the uses links in between modules in the current crate, while removing the ones pointing to external items. Removing the --with-uses parameter removes the external items, but also removes the links inside the crate.

from cargo-modules.

regexident avatar regexident commented on June 21, 2024

@ejmount Hm, when I run the same command I get exactly what you "actually want":

image

I've added a corresponding snapshot test here: #175

Are you sure you didn't accidentally also add --with-externs? Nodes with "external" should only ever get generated if --with-externs was provided.

from cargo-modules.

visd0m avatar visd0m commented on June 21, 2024

I have the same issue, don't know If I can help somehow.

from cargo-modules.

SebastianHambura avatar SebastianHambura commented on June 21, 2024

I've tried running cargo modules generate graph --types --uses --traits --layout dot --no-externs | dot -Tpng -O and cargo modules generate graph --types --uses --traits --layout dot | dot -Tpng -O and i both cases I get the same (wrong) result as @ejmount

In case it helps, on my setup I have :

  • cargo-modules v0.9.0
  • rustc 1.67.1
  • cargo 1.67.1

from cargo-modules.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.