Crates.io | Secondwelcome |
lib.rs | Secondwelcome |
version | 0.1.2 |
source | src |
created_at | 2020-11-29 08:19:38.227061 |
updated_at | 2020-11-29 08:29:16.005368 |
description | Second Welcome Library |
homepage | https://github.com/ShahzadTabassum/Secondwelcome |
repository | https://github.com/ShahzadTabassum/Secondwelcome |
max_upload_size | |
id | 317696 |
size | 14,293 |
this is a demo rust library published on crates.io
to use this library you have to add following line in dependency section of cargo.toml
Secondwelcome = "0.1.2"
your cargo.toml file should look like this:
[package]
name = "hello_world"
version = "0.1.2"
authors = ["ShahzadTabassum <www.shahzadtabassum786@gmail.com>"]
edition = "2018"
[dependencies]
Secondwelcome = "0.1.2"
In src/main.rs
you can use like this:
use Secondwelcome;
fn main() {
println!("Hello, world!");
Secondwelcome::hello();
}
following will also work:
use Secondwelcome::hello;
fn main() {
println!("Hello, world!");
hello();
}
now cargo run
for results