From ec94d1b299008476f2810d5ec83ab32fa812d0e3 Mon Sep 17 00:00:00 2001 From: Kamil Baraniak <90936580+kbaraniak@users.noreply.github.com> Date: Thu, 19 Oct 2023 11:07:51 +0000 Subject: [PATCH] Initial version --- .gitignore | 1 + src/lib.rs | 12 ++++++++++-- testapi/Cargo.lock | 14 ++++++++++++++ testapi/Cargo.toml | 9 +++++++++ testapi/src/main.rs | 6 ++++++ 5 files changed, 40 insertions(+), 2 deletions(-) create mode 100644 testapi/Cargo.lock create mode 100644 testapi/Cargo.toml create mode 100644 testapi/src/main.rs diff --git a/.gitignore b/.gitignore index 4fffb2f..3487421 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ /target +/testapi/target /Cargo.lock diff --git a/src/lib.rs b/src/lib.rs index 1e4cd4d..7da5b2a 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -1,3 +1,11 @@ -pub fn hello(){ - print("Welcome"); +pub fn hello() -> String { + println!("Welcome"); + "Hello\n".to_string() +} + + +#[test] +fn test() { + hello(); + println!("") } \ No newline at end of file diff --git a/testapi/Cargo.lock b/testapi/Cargo.lock new file mode 100644 index 0000000..db299fd --- /dev/null +++ b/testapi/Cargo.lock @@ -0,0 +1,14 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 3 + +[[package]] +name = "librus-api" +version = "1.0.0" + +[[package]] +name = "testapi" +version = "0.1.0" +dependencies = [ + "librus-api", +] diff --git a/testapi/Cargo.toml b/testapi/Cargo.toml new file mode 100644 index 0000000..f9c3c4d --- /dev/null +++ b/testapi/Cargo.toml @@ -0,0 +1,9 @@ +[package] +name = "testapi" +version = "0.1.0" +edition = "2021" + +# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html + +[dependencies.librus-api] +path = ".." diff --git a/testapi/src/main.rs b/testapi/src/main.rs new file mode 100644 index 0000000..af05c1b --- /dev/null +++ b/testapi/src/main.rs @@ -0,0 +1,6 @@ +use librus_api::hello; + +fn main() { + // println!("Hello, world!"); + hello(); +}