From 94461a069758ad92aaff0d14a051d6105f0c1ce4 Mon Sep 17 00:00:00 2001 From: Canvas02 Date: Fri, 14 Jan 2022 18:03:39 +0200 Subject: [PATCH] Extraced API into diffrent crate --- paste_rs-cli/.editorconfig => .editorconfig | 0 Cargo.toml | 4 ++++ paste_rs-cli/.gitignore | 13 ------------- paste_rs-cli/Cargo.toml | 7 +------ paste_rs-cli/src/main.rs | 4 ++-- 5 files changed, 7 insertions(+), 21 deletions(-) rename paste_rs-cli/.editorconfig => .editorconfig (100%) delete mode 100644 paste_rs-cli/.gitignore diff --git a/paste_rs-cli/.editorconfig b/.editorconfig similarity index 100% rename from paste_rs-cli/.editorconfig rename to .editorconfig diff --git a/Cargo.toml b/Cargo.toml index 2166828..ce457b1 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,2 +1,6 @@ [workspace] members = ["paste_rs-cli", "paste_rs_api"] + +[profile.release] +lto = true +opt-level = 3 diff --git a/paste_rs-cli/.gitignore b/paste_rs-cli/.gitignore deleted file mode 100644 index a8251da..0000000 --- a/paste_rs-cli/.gitignore +++ /dev/null @@ -1,13 +0,0 @@ -# Generated by Cargo -# will have compiled files and executables -debug/ -target/ - -# These are backup files generated by rustfmt -**/*.rs.bk - -# MSVC Windows builds of rustc generate these, which store debugging information -*.pdb - -# Files to test filesystem functions -test_file.* \ No newline at end of file diff --git a/paste_rs-cli/Cargo.toml b/paste_rs-cli/Cargo.toml index 3639dfc..3ba48ab 100644 --- a/paste_rs-cli/Cargo.toml +++ b/paste_rs-cli/Cargo.toml @@ -16,10 +16,5 @@ edition = "2021" [dependencies] clap = { version = "3.0", features = ["derive"] } tokio = { version = "1", features = ["macros", "rt-multi-thread"] } -# paste_rs-cli = { path = "../paste-rs_api" } +paste_rs_api = "0.1.0" # directories = "4.0" - -[profile.release] -lto = true -opt-level = 3 -incremental = true diff --git a/paste_rs-cli/src/main.rs b/paste_rs-cli/src/main.rs index 9e25f24..753ebc0 100644 --- a/paste_rs-cli/src/main.rs +++ b/paste_rs-cli/src/main.rs @@ -11,8 +11,8 @@ // TODO: implement cache // mod cache; -use crate::paste::Url; use clap::{AppSettings, Parser, Subcommand}; +use paste_rs_api::Url; use std::fs; #[tokio::main] @@ -60,7 +60,7 @@ async fn main() { } }; - let url = match paste::new_paste(data).await { + let url = match paste_rs_api::new_paste(data).await { Ok(res) => res, Err(err) => { eprintln!("ERROR: {:#?}", err);