From 29ab2e28775013a2cbbb3eb5dd306b5e2f251d19 Mon Sep 17 00:00:00 2001 From: Fuwn Date: Thu, 28 Apr 2022 18:27:06 -0700 Subject: feat: release 0.1.0 --- src/lib.rs | 76 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 76 insertions(+) create mode 100644 src/lib.rs (limited to 'src') 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 . +// Copyright (C) 2022-2022 Fuwn +// +// 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 . +// +// Copyright (C) 2022-2022 Fuwn +// 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 { + a: T, + b: T, +} +impl Adder +where T: std::ops::Add +{ + pub const fn new(a: T, b: T) -> Self { + Self { + a, + b, + } + } + + pub fn add(self) -> T { self.a + self.b } +} -- cgit v1.2.3