aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorFuwn <[email protected]>2022-04-28 18:27:06 -0700
committerFuwn <[email protected]>2022-04-28 18:27:06 -0700
commit29ab2e28775013a2cbbb3eb5dd306b5e2f251d19 (patch)
treebb3216edb1db832d21afc0358a2ec2fdd18ef444 /src
downloadrust-crate-template-29ab2e28775013a2cbbb3eb5dd306b5e2f251d19.tar.xz
rust-crate-template-29ab2e28775013a2cbbb3eb5dd306b5e2f251d19.zip
feat: release 0.1.0
Diffstat (limited to 'src')
-rw-r--r--src/lib.rs76
1 files changed, 76 insertions, 0 deletions
diff --git a/src/lib.rs b/src/lib.rs
new file mode 100644
index 0000000..e2d3000
--- /dev/null
+++ b/src/lib.rs
@@ -0,0 +1,76 @@
+// This file is part of Rust Crate Template <https://github.com/Fuwn/rust-crate-template>.
+// Copyright (C) 2022-2022 Fuwn <[email protected]>
+//
+// This program is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, version 3.
+//
+// This program is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program. If not, see <http://www.gnu.org/licenses/>.
+//
+// Copyright (C) 2022-2022 Fuwn <[email protected]>
+// SPDX-License-Identifier: GPL-3.0-only
+
+//! # Rust Crate Template
+//! ///!
+//! [![crates.io](https://img.shields.io/crates/v/rust-crate-template.svg)](https://crates.io/crates/rust-crate-template)
+//! [![docs.rs](https://docs.rs/rust-crate-template/badge.svg)](https://docs.rs/rust-crate-template)
+//! [![github.com](https://github.com/Fuwn/rust-crate-template/actions/workflows/check.yaml/badge.svg?branch=main)](https://github.com/Fuwn/rust-crate-template/actions/workflows/check.yaml)
+//!
+//! Rust Crate Template is a Rust crate template.
+//!
+//! ## Usage
+//!
+//! ### Add Rust Crate Template as a dependency
+//!
+//! ```toml
+//! # Cargo.toml
+//!
+//! [dependencies]
+//! rust-crate-template = "0.1.0"
+//! ```
+//!
+//! ## Examples
+//!
+//! Examples can be found within the
+//! [`examples/`](https://github.com/Fuwn/rust-crate-template/tree/main/examples) directory.
+//!
+//! ## License
+//!
+//! This project is licensed with the
+//! [GNU General Public License v3.0](https://github.com/Fuwn/rust-crate-template/blob/main/LICENSE).
+
+#![deny(
+ warnings,
+ nonstandard_style,
+ unused,
+ future_incompatible,
+ rust_2018_idioms,
+ unsafe_code,
+ clippy::all,
+ clippy::nursery,
+ clippy::pedantic
+)]
+#![recursion_limit = "128"]
+
+pub struct Adder<T> {
+ a: T,
+ b: T,
+}
+impl<T> Adder<T>
+where T: std::ops::Add<Output = T>
+{
+ pub const fn new(a: T, b: T) -> Self {
+ Self {
+ a,
+ b,
+ }
+ }
+
+ pub fn add(self) -> T { self.a + self.b }
+}