From a242791f52f892b7031808cc7a660ff5b3b7baff Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=94=D0=B5=D0=BD=D0=B8=D1=81=20=D0=9A=D0=BE=D1=82=D0=BB?= =?UTF-8?q?=D1=8F=D1=80=D0=BE=D0=B2?= Date: Sat, 11 May 2024 03:58:33 +0300 Subject: [PATCH] 1. Removing Travis 2. Refactoring tests 3. Minor changes --- .travis.yml | 10 ---------- examples/generic.rs | 2 +- src/lib.rs | 16 ++++++++++------ tests/{contract_transmute.rs => contract.rs} | 0 tests/{easy.rs => generic.rs} | 2 -- tests/{easy_transmute.rs => struct.rs} | 0 6 files changed, 11 insertions(+), 19 deletions(-) delete mode 100644 .travis.yml rename tests/{contract_transmute.rs => contract.rs} (100%) rename tests/{easy.rs => generic.rs} (98%) rename tests/{easy_transmute.rs => struct.rs} (100%) diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index a8e34f6..0000000 --- a/.travis.yml +++ /dev/null @@ -1,10 +0,0 @@ -language: rust -cache: cargo -rust: - - nightly -branches: - only: - - master -script: - - cargo build --verbose - - cargo test --verbose diff --git a/examples/generic.rs b/examples/generic.rs index ffb388d..096b0e6 100644 --- a/examples/generic.rs +++ b/examples/generic.rs @@ -2,7 +2,7 @@ use core::fmt::Display; use cluFullTransmute::transmute_or_panic; -/// Implementation of a simple transmutation with a generic parameter inside. +// Implementation of a simple transmutation with a generic parameter inside. #[derive(Debug)] #[repr(transparent)] diff --git a/src/lib.rs b/src/lib.rs index e9e1531..e71aa70 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -1,4 +1,4 @@ -//Copyright 2022 #UlinProject Denis Kotlyarov (Денис Котляров) +//Copyright 2022-2024 #UlinProject Denis Kotlyarov (Денис Котляров) //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. @@ -12,7 +12,7 @@ //See the License for the specific language governing permissions and // limitations under the License. -// #Ulin Project 2022 +// #Ulin Project 2022-2024 /*! A more complete and extended version of data type conversion without constraint checks. @@ -32,7 +32,7 @@ A more complete and extended version of data type conversion without constraint # Use -### 1. GenericType +### 1. Generic ```rust use core::fmt::Display; @@ -157,7 +157,7 @@ fn main() { #![cfg_attr(docsrs, feature(doc_cfg))] #![cfg_attr(not(feature = "support_stderr"), no_std)] -/// Basic functions for dealing with memory. +/// Basic functions for dealing with memory. /// /// (An optional module for ensuring compatibility with the standard library, which is turned on and off with the `compatible_stdapi` build flag.) #[cfg_attr(docsrs, doc(cfg(feature = "compatible_stdapi")))] @@ -252,7 +252,9 @@ pub const unsafe fn inline_transmute_or_panic(in_data: D) -> To { /// If the size does not match, an error occurs. #[cfg_attr(docsrs, doc(cfg(feature = "support_size_check_transmute")))] #[cfg( any(test, feature = "support_size_check_transmute") )] -pub const unsafe fn transmute_or_errresult(in_data: D) -> Result> { +pub const unsafe fn transmute_or_errresult( + in_data: D +) -> Result> { { // #1: Data dimension check let size_d = size_of::(); let size_to = size_of::(); @@ -279,7 +281,9 @@ pub const unsafe fn transmute_or_errresult(in_data: D) -> Result(in_data: D) -> Result> { +pub const unsafe fn inline_transmute_or_errresult( + in_data: D +) -> Result> { { // #1: Data dimension check let size_d = size_of::(); let size_to = size_of::(); diff --git a/tests/contract_transmute.rs b/tests/contract.rs similarity index 100% rename from tests/contract_transmute.rs rename to tests/contract.rs diff --git a/tests/easy.rs b/tests/generic.rs similarity index 98% rename from tests/easy.rs rename to tests/generic.rs index 6fae192..385feee 100644 --- a/tests/easy.rs +++ b/tests/generic.rs @@ -1,6 +1,4 @@ -extern crate cluFullTransmute; - use std::hash::Hasher; use std::hash::Hash; use std::collections::hash_map::DefaultHasher; diff --git a/tests/easy_transmute.rs b/tests/struct.rs similarity index 100% rename from tests/easy_transmute.rs rename to tests/struct.rs