Rust programming - A question on iota text editor


#1
The main.rs in iota-master/src has the following declaration:
    extern crate iota;

Why is this required? Is there another external crate by the name iota?

Thanks and regards,
Raj Mohan


#2

The Cargo.toml for Iota shows that the directory contains two crates:

[lib]
name = "iota"
path = "src/iota/lib.rs"

[[bin]]
name = "iota"
doc = false

The extern crate iota in the iota bin crate is a dependency on the iota lib crate.


#3

It is clear to me now. Thank you.

Raj Mohan


#4

Continuing on with @dtolnay’s answer, it looks like iota is following a common pattern where you put all your application’s main logic in a library so then the main.rs is a simple program which does some setup then calls the various library routines.


#5

Thank you for the answer.
Now I have another question on the iota text editor.

When I open the editor, the characters that I type appear faint grey on a white background. Also, the status line is dark blue with unreadable text in black.

Is there some configuration setting required. When I checked the source code, I found reference to the sublime-text-3. So I had that also installed on my machine. Still I get the same result.

Any help will be greatly appreciated.

Thanks and regards,
Raj Mohan