Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
    Ingvar Stepanyan
    @RReverser
    To elaborate a little bit more - I'm going to store information associated with nodes in a tree retrieved from an external crate, so just adding data members is not really an option (without forking that crate just for this purpose); recreating entire tree but with wrappers around each node also seems too expensive (and requires lots of code to handle all kinds of nodes).
    The only approach that seems to allow this so far is defining custom allocator which would reserve extra space on objects, but I'm not sure I want to go down that way and hope for a simpler solution.
    Benjamin Z
    @benjyz
    Hi. noob here. I'm trying to create a sqlite database
    let conn = Connection::open_in_memory().unwrap();
    the doc tells me I can open like this: open<P: AsRef<Path>>(path: P) -> Result<Connection>
    Benjamin Z
    @benjyz
    nice.. got it let conn = Connection::open(path).unwrap();
    Benjamin Z
    @benjyz
    how do I put off warnings in cargo?
    Thomas Koehler
    @Bastacyclop
    which warnings ?
    Benjamin Z
    @benjyz
    "function is never used: xyz, #[warn(dead_code)] on by default"
    e.g.
    Thomas Koehler
    @Bastacyclop
    FYI this comes from the rust compiler (rustc) which is called by cargo. You can use #[allow(dead_code)] in the code. This is called an attribute https://doc.rust-lang.org/book/attributes.html.
    Benjamin Z
    @benjyz
    thanks. equally I try to ignore other warnings with
    warning: unused import, #[warn(unused_imports)] on by default
    with this.. doesn't work
    "#![warn(unused_imports)]"
    Thomas Koehler
    @Bastacyclop
    #[warn(stuff)] means you want a warning
    #[allow(stuff)] means you don't want anything
    #[deny(stuff)] means you want an error
    wow
    Benjamin Z
    @benjyz
    cool
    Thomas Koehler
    @Bastacyclop
    Benjamin Z
    @benjyz
    more basic question: what is a crate?
    "The compilation model centers on artifacts called crates. "
    Thomas Koehler
    @Bastacyclop
    Have you read the Book ?
    Benjamin Z
    @benjyz
    notyet
    not yet
    Thomas Koehler
    @Bastacyclop
    you should :p
    Benjamin Z
    @benjyz
    yes, very well written
    the parts I have read so far
    any other standard docs? I've listened to some talks recently
    Thomas Koehler
    @Bastacyclop
    Benjamin Z
    @benjyz
    talks by Alex Crichton
    Thomas Koehler
    @Bastacyclop
    I think the Book is the first thing to read, there is a lot of extra stuff in rust-learning
    Benjamin Z
    @benjyz
    does rust compiler use LLVM somewhere?
    ok, thx, will go through that
    Thomas Koehler
    @Bastacyclop
    You also have the Cargo guide
    I think it does compile to LLVM which is then compiled to binary but I'm not the best person to ask
    ^ this is a nice place to get news
    @benjyz if you are interested in the compilation process: https://blog.rust-lang.org/2016/04/19/MIR.html
    Benjamin Z
    @benjyz
    ah right, I remember seeing that
    MIR.. so much to learn ;)
    finally a systems language which isn't C/++
    Thomas Koehler
    @Bastacyclop
    ahah
    I gotta say when I have to go back to C++ it hurts
    Benjamin Z
    @benjyz
    have you a lot of experience in C++? I always hated C++ with a passion and never used it
    Thomas Koehler
    @Bastacyclop
    I don't have "a lot of experience" since I'm a student but it was my main language before Rust
    Thomas Koehler
    @Bastacyclop
    personnaly I hate Java a lot more :p
    Alexander Chepurnoy
    @kushti
    @Bastacyclop probably you havent' experienced a memory leak in pretty big project yet? :)
    after searching for a memory leak in C++ in more or less big project people usually going to love Java :)
    Thomas Koehler
    @Bastacyclop
    well you can have memory leaks in Java too, so ... :p