commit_hash stringlengths 40 40 | author stringlengths 1 57 | date timestamp[s]date 2010-07-26 04:45:09 2026-04-14 18:21:10 | message stringlengths 8 1.39M | diff stringlengths 68 51.2k | files_changed int64 1 136 | insertions int64 0 2.35k | deletions int64 0 1.9k |
|---|---|---|---|---|---|---|---|
de4525e475790c61f46ef3415ba87a1e10d68330 | Trevor Spiteri | 2018-01-06T12:24:24 | update `is_sign_positive` and `is_sign_negative` to match `std` | diff --git a/src/lib.rs b/src/lib.rs
index 3fd47f7..4bde8ee 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -343,7 +343,8 @@ pub fn signum(self) -> f16 {
}
}
- /// Returns `true` if `self`'s sign bit is positive, including `+0.0` and `INFINITY`.
+ /// Returns `true` if and only if `self` has a positiv... | 1 | 10 | 8 |
22b5bd6c086d4caf8651bf5b866241ba8ce67407 | Trevor Spiteri | 2018-01-06T12:23:04 | fix comparisons and add some tests | diff --git a/src/lib.rs b/src/lib.rs
index 4fc2194..3fd47f7 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -414,7 +414,11 @@ fn from(x: u8) -> f16 {
impl PartialEq for f16 {
fn eq(&self, other: &f16) -> bool {
- !self.is_nan() && !other.is_nan() && self.0 == other.0
+ if self.is_nan() || other.is_nan... | 1 | 127 | 10 |
198ced11dc7709b5eb1b0766a4a2172091741422 | Trevor Spiteri | 2018-01-06T11:06:05 | optimize `is_nan` and `is_infinite` | diff --git a/src/lib.rs b/src/lib.rs
index ecd95f8..4fc2194 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -201,7 +201,7 @@ fn to_f64(self) -> f64 {
/// ```
#[inline]
pub fn is_nan(self) -> bool {
- (self.0 & 0x7C00u16 == 0x7C00u16) && (self.0 & 0x03FFu16 != 0)
+ self.0 & 0x7FFFu16 > 0x7C00u16... | 1 | 2 | 2 |
6e51b65df5ea353ea56495539233dc0263032a04 | Kathryn Long | 2017-08-30T07:59:48 | minor update to module docs | diff --git a/src/lib.rs b/src/lib.rs
index a776acc..ecd95f8 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -14,9 +14,13 @@
//! checks on whether the hardware supports the feature. This feature currently only works on
//! nightly Rust due to a compiler feature gate.
//!
-//! Support for serde crate `Serialize` and `Dese... | 1 | 5 | 1 |
ffeb7fa42d446753c8f9d22e72693b39f5c56bec | Kathryn Long | 2017-08-30T07:48:50 | 1.0.1 version bump | diff --git a/Cargo.toml b/Cargo.toml
index bb1e3d9..d7cbfa7 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -1,6 +1,6 @@
[package]
name = "half"
-version = "1.0.0"
+version = "1.0.1"
authors = ["Kathryn Long <squeeself@gmail.com>"]
description = "Half-precision floating point f16 type for Rust implementing the IEEE 754... | 1 | 1 | 1 |
226186d54c661c5251b8e77e40988f857bc8c6aa | Kathryn Long | 2017-08-30T07:44:58 | update cargo metadata and use stable serde | diff --git a/Cargo.toml b/Cargo.toml
index 182e6ec..bb1e3d9 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -3,12 +3,16 @@ name = "half"
version = "1.0.0"
authors = ["Kathryn Long <squeeself@gmail.com>"]
description = "Half-precision floating point f16 type for Rust implementing the IEEE 754-2008 binary16 type."
-reposi... | 1 | 9 | 5 |
1b49f9f56d2df6748377dfaff1e156df8fc4449e | Kathryn Long | 2017-02-03T03:01:24 | doc: update optional feature docs | diff --git a/src/lib.rs b/src/lib.rs
index 8ef20eb..a776acc 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -11,11 +11,12 @@
//!
//! Some hardware architectures provide support for 16-bit floating point conversions. Enable the
//! `use-intrinsics` feature to use LLVM intrinsics for hardware conversions. This crate does ... | 1 | 5 | 4 |
0f5a283ae73805821397126fdcef0099aee39ed2 | Kathryn Long | 2017-02-03T02:55:46 | feat: use serde 0.9 and stable Rust 1.15 for serialize feature
serde 0.9 fixed the bug with serde_derive requiring std, so serialize
feature can now be no_std. serde_derive is also usable without feature
gate on stable Rust 1.15, so removed feature gate. | diff --git a/Cargo.toml b/Cargo.toml
index 1f0cdc8..f8ed08b 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -13,8 +13,8 @@ license = "MIT/Apache-2.0"
[features]
std = []
use-intrinsics = []
-serialize = ["serde", "serde_derive", "std"] # Serde_derive has bug requiring std until 0.9, see https://github.com/serde-rs/serde... | 2 | 3 | 4 |
0d01e176c66cc858768420d46b559cbcb469d7bf | Kathryn Long | 2017-01-08T00:27:31 | feat: use no_std for crate by default | diff --git a/Cargo.toml b/Cargo.toml
index c26207f..1f0cdc8 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -7,12 +7,13 @@ repository = "https://github.com/starkat99/half-rs.git"
homepage = "https://github.com/starkat99/half-rs"
documentation = "http://starkat99.github.io/half-rs/half/"
readme = "README.md"
-keywords = ... | 2 | 55 | 49 |
cca2f15f5201a54aa61a065bb9aec46c0a79f41a | Kathryn Long | 2017-01-07T06:46:41 | feat: add serde support under `serialize` feature | diff --git a/Cargo.toml b/Cargo.toml
index d4b0059..c26207f 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -1,6 +1,6 @@
[package]
name = "half"
-version = "0.1.0"
+version = "0.1.1"
authors = ["Kathryn Long <squeeself@gmail.com>"]
description = "Half-precision floating point f16 type for Rust implementing the IEEE 754... | 2 | 17 | 2 |
36e1d483b5385821e315750a35e19bcc79b00dd8 | Kathryn Long | 2016-02-25T22:37:50 | Added consts and unit tests | diff --git a/src/lib.rs b/src/lib.rs
index 00f41ca..7a0f606 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -33,34 +33,85 @@
#[derive(Clone, Copy, Default)]
pub struct f16(u16);
-/// 16-bit equivalent of `std::f32::DIGITS`
-pub const DIGITS: u32 = 3;
-/// 16-bit floating point epsilon.
-pub const EPSILON: f16 = f16(0x1... | 1 | 231 | 48 |
a73e63714c0a64b4bfa4568713836d8bc0b70705 | Kathryn Long | 2016-02-25T20:09:17 | Added optional support for LLVM intrinsics for conversion | diff --git a/Cargo.toml b/Cargo.toml
index 9571442..9e8db66 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -3,4 +3,5 @@ name = "f16"
version = "0.1.0"
authors = ["Kathryn Long <squeeself@gmail.com>"]
-[dependencies]
+[features]
+use-intrinsics = []
\ No newline at end of file
diff --git a/src/lib.rs b/src/lib.rs
index... | 2 | 303 | 239 |
02a8176fd83d9de0049295102f21b500d512cb66 | Kathryn Long | 2016-02-25T07:53:40 | Added custom Debug implementation | diff --git a/src/lib.rs b/src/lib.rs
index 25360f6..03a728c 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -27,11 +27,11 @@
use std::num::{FpCategory, ParseFloatError};
use std::cmp::Ordering;
use std::str::FromStr;
-use std::fmt::{Display, LowerExp, UpperExp, Formatter, Error};
+use std::fmt::{Debug, Display, LowerExp... | 1 | 8 | 2 |
62881a581d4b87aa57b368cf8257039cae813c56 | Kathryn Long | 2016-02-25T07:51:03 | Added rustdocs | diff --git a/src/lib.rs b/src/lib.rs
index f403ddc..25360f6 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -1,36 +1,82 @@
+//! A crate that provides support for the half-precision floating point type.
+//!
+//! This crate provides the `f16` type, which is an implementation of the IEEE 754-2008 `binary16`
+//! floating poi... | 1 | 228 | 26 |
8bea260e2aeba3938d30194bac310ee9327c0282 | Kathryn Long | 2016-02-25T05:30:09 | Filled out traits and constants | diff --git a/src/lib.rs b/src/lib.rs
index a31a9c7..f403ddc 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -1,13 +1,32 @@
-
use std::mem;
+use std::num::{FpCategory, ParseFloatError};
+use std::cmp::Ordering;
+use std::str::FromStr;
+use std::fmt::{Display, LowerExp, UpperExp, Formatter, Error};
#[allow(non_camel_case... | 1 | 178 | 25 |
dd85c3a85ae9de3be81a52fd3a0e772db42cae44 | Kathryn Long | 2016-02-25T00:30:39 | Updated crate name | diff --git a/Cargo.toml b/Cargo.toml
index 625d5eb..9571442 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -1,5 +1,5 @@
[package]
-name = "half"
+name = "f16"
version = "0.1.0"
authors = ["Kathryn Long <squeeself@gmail.com>"] | 1 | 1 | 1 |
a34b4cba0e59ac17d442b03310010da69cf93e06 | Kathryn Long | 2016-02-24T23:25:42 | Basic floating point conversion | diff --git a/src/lib.rs b/src/lib.rs
index 355e556..a31a9c7 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -1,4 +1,273 @@
+use std::mem;
+
#[allow(non_camel_case_types)]
-#[derive(Debug, Clone, Copy)]
-pub struct f16(u16);
\ No newline at end of file
+#[derive(Debug, Clone, Copy, Default)]
+pub struct f16(u16);
+
+// T... | 1 | 271 | 2 |
249912e30a172109846ad20442214f441d4ce282 | Kathryn Long | 2025-12-31T07:21:52 | Exclude .mailmap | diff --git a/Cargo.toml b/Cargo.toml
index 561931b..62498e0 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -10,7 +10,7 @@ categories = ["text-processing", "encoding", "development-tools::ffi", "no-std"]
license = "MIT OR Apache-2.0"
edition = "2021"
rust-version = "1.58"
-exclude = [".git*", ".editorconfig"]
+exclude =... | 1 | 1 | 1 |
760fdaa9400f5bec06af4b646a4f9b02ca9b7197 | Benjamin A. Beasley | 2025-11-02T07:03:52 | Do not require the windows_sys dev-dependency on non-Windows platforms | diff --git a/Cargo.toml b/Cargo.toml
index 561931b..0c6bd9c 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -23,6 +23,8 @@ debugger_visualizer = ["alloc"]
[dev-dependencies]
debugger_test = "0.1"
debugger_test_parser = "0.1"
+
+[target.'cfg(windows)'.dev-dependencies]
windows-sys = { version = "0.59", features = [
... | 2 | 4 | 0 |
ddfb46bf2bb38eb5d6dbc6e171013b42de9ebf55 | Kathryn Long | 2025-10-09T01:24:58 | Remove debugger visualizer test on windows | diff --git a/tests/debugger_visualizer.rs b/tests/debugger_visualizer.rs
index 9dc8331..f4f8006 100644
--- a/tests/debugger_visualizer.rs
+++ b/tests/debugger_visualizer.rs
@@ -1,4 +1,5 @@
#![allow(unsupported_calling_conventions)]
+#![cfg(not(windows))]
use debugger_test::debugger_test;
use widestring::*;
@@ -6,7... | 1 | 1 | 1 |
0ce3b46bd245ce243ed8db086e9254a2a214cb57 | Kathryn Long | 2025-10-09T01:21:22 | Remove debugger visualizer test on windows | diff --git a/tests/debugger_visualizer.rs b/tests/debugger_visualizer.rs
index 24abb25..9dc8331 100644
--- a/tests/debugger_visualizer.rs
+++ b/tests/debugger_visualizer.rs
@@ -6,6 +6,7 @@
#[inline(never)]
fn __break() {}
+#[cfg_attr(windows, ignore)]
#[debugger_test(
debugger = "cdb",
commands = r#" | 1 | 1 | 0 |
1d481ae1673de910b4a3a66352ed83d6038b4ddb | Kathryn Long | 2025-10-09T01:16:49 | Fix debugger visualizer lint warning | diff --git a/tests/debugger_visualizer.rs b/tests/debugger_visualizer.rs
index 4b5edb7..24abb25 100644
--- a/tests/debugger_visualizer.rs
+++ b/tests/debugger_visualizer.rs
@@ -1,10 +1,11 @@
+#![allow(unsupported_calling_conventions)]
+
use debugger_test::debugger_test;
use widestring::*;
#[inline(never)]
fn __br... | 1 | 2 | 1 |
6fab4fe8d79e5078ba7f53fe802143f32e526dc9 | Kathryn Long | 2025-10-09T01:12:26 | Fix unused_import lint in macros | diff --git a/src/macros.rs b/src/macros.rs
index 78551fa..4b390d8 100644
--- a/src/macros.rs
+++ b/src/macros.rs
@@ -184,7 +184,8 @@ macro_rules! $name {
#[macro_export]
macro_rules! widestr {
($text:expr) => {{
- use $crate::u32str;
+ #[allow(unused_imports)]
+ use $crate::*;
u32st... | 1 | 12 | 6 |
91148e4162d726e527fef2338dcf518d075fadbe | Kathryn Long | 2025-10-09T01:01:58 | Fix panic in U16String::insert_char. Fixes #46 | diff --git a/src/ustring.rs b/src/ustring.rs
index 5803e63..2886ae4 100644
--- a/src/ustring.rs
+++ b/src/ustring.rs
@@ -1338,9 +1338,10 @@ pub fn insert_char(&mut self, idx: usize, c: char) {
assert!(idx <= self.len());
let mut buf = [0; 2];
let slice = c.encode_utf16(&mut buf);
+ let... | 1 | 11 | 2 |
23bddba4101e007abebfff4221238d121cba0e05 | Kathryn Long | 2025-05-29T01:36:03 | Fix rustdoc warnings | diff --git a/src/ustr.rs b/src/ustr.rs
index a662d8a..4b1e452 100644
--- a/src/ustr.rs
+++ b/src/ustr.rs
@@ -524,7 +524,7 @@ fn partial_cmp(&self, other: &crate::$ucstr) -> Option<core::cmp::Ordering> {
ustr_common_impl! {
/// 16-bit wide string slice with undefined encoding.
///
- /// [`U16Str`] is to [`... | 3 | 5 | 5 |
f0caea75de14fe70198d52fd7381f66000e0dabd | Kathryn Long | 2025-05-29T01:28:17 | Allow clippy lint to fix clippying warnings | diff --git a/src/lib.rs b/src/lib.rs
index 286d5c8..392488c 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -655,6 +655,7 @@ fn range<R>(range: R, bounds: core::ops::RangeTo<usize>) -> core::ops::Range<usi
#[inline(never)]
#[cold]
#[track_caller]
+ #[allow(unknown_lints, clippy::uninlined_format_args)]
... | 1 | 2 | 0 |
7e412ac910c58dfcba738a11736e55ee33bb5ed9 | Yotam Ofek | 2025-05-26T19:13:00 | Fix docs for `WideCString`(s) | diff --git a/src/ucstring.rs b/src/ucstring.rs
index b57edcf..f2e4015 100644
--- a/src/ucstring.rs
+++ b/src/ucstring.rs
@@ -1653,12 +1653,12 @@ fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
}
}
-/// Alias for `U16String` or `U32String` depending on platform. Intended to match typical C... | 1 | 2 | 2 |
a169b653ee0ba96fcc9b02564fa676200dac6ee2 | syr | 2025-04-03T17:37:00 | Fix `trim_end` to handle 4-byte characters correctly | diff --git a/src/utfstr.rs b/src/utfstr.rs
index 2bf5f00..03254c1 100644
--- a/src/utfstr.rs
+++ b/src/utfstr.rs
@@ -25,6 +25,16 @@
pub use iter::*;
+#[inline]
+const fn char_len_utf16(c: char) -> usize {
+ c.len_utf16()
+}
+
+#[inline]
+const fn char_len_utf32(_c: char) -> usize {
+ 1
+}
+
macro_rules! utf... | 1 | 27 | 2 |
96d4bc4683605da9fe43ba4b8d8a4ae28ed337ea | Kathryn Long | 2025-03-21T19:50:33 | Update repository link | diff --git a/Cargo.toml b/Cargo.toml
index 9a6bc7d..946c114 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -3,7 +3,7 @@ name = "widestring"
# Remember to keep in sync with html_root_url crate attribute
version = "1.2.0"
description = "A wide string Rust library for converting to and from wide strings, such as those oft... | 1 | 1 | 1 |
e522e4d12b28e2e71197ba8293e4421b3f980d20 | Kathryn Long | 2025-03-15T21:48:23 | undo cargo update | diff --git a/Cargo.lock b/Cargo.lock
index 0cdc101..3b9a06f 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -4,18 +4,18 @@ version = 3
[[package]]
name = "aho-corasick"
-version = "1.1.3"
+version = "0.7.20"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "8e60d3430d3a69478ad0993f19238d2df... | 1 | 18 | 30 |
5283276dbeeba2107b7712ae032bb8cf01d7cc92 | Kathryn Long | 2025-03-15T21:44:14 | compile fix | diff --git a/src/utfstring.rs b/src/utfstring.rs
index b26772b..e81ad6d 100644
--- a/src/utfstring.rs
+++ b/src/utfstring.rs
@@ -2680,7 +2680,7 @@ mod test {
fn uft16_truncate() {
// Bug #39
let cs = utf16str!("trunc");
- let mut s = cs.to_owned();
+ let mut s: Utf16String = cs.into... | 1 | 1 | 1 |
8ead488699446d398417248746c1d599c63bca22 | Kathryn Long | 2025-03-15T21:41:39 | cargo update | diff --git a/Cargo.lock b/Cargo.lock
index 3b9a06f..0cdc101 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -4,18 +4,18 @@ version = 3
[[package]]
name = "aho-corasick"
-version = "0.7.20"
+version = "1.1.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "cc936419f96fa211c1b9166887b38e5e4... | 1 | 30 | 18 |
7e7065ac6e0f0a0bd72f6d8d104c8756d3292724 | Kathryn Long | 2025-03-15T20:01:15 | fix doc tests in no_std | diff --git a/src/utfstr.rs b/src/utfstr.rs
index 36129f7..2bf5f00 100644
--- a/src/utfstr.rs
+++ b/src/utfstr.rs
@@ -1443,7 +1443,7 @@ pub fn to_uppercase(&self) -> Utf16String {
/// Basic usage:
///
/// ```
- /// use widestring::{Utf16String, utf16str};
+ /// use widestring::utf16str;
///
... | 1 | 4 | 4 |
c1053c3445f6612cc1aeca44c7bdd28660a959d3 | Kathryn Long | 2025-03-15T19:49:55 | fix clippy warnings | diff --git a/src/lib.rs b/src/lib.rs
index fe93139..52ff366 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -597,7 +597,7 @@ const fn is_utf16_low_surrogate(u: u16) -> bool {
/// Convert a UTF-16 surrogate pair to a `char`. Does not validate if the surrogates are valid.
#[inline(always)]
unsafe fn decode_utf16_surrogate... | 6 | 67 | 74 |
29b855552e64f3e0b4d24a34efb90a728d7ec97a | Adam Fortune | 2025-02-01T16:43:37 | Implement .lines() method on various string slices | diff --git a/src/ustr.rs b/src/ustr.rs
index eca3e13..725ffaa 100644
--- a/src/ustr.rs
+++ b/src/ustr.rs
@@ -2,6 +2,7 @@
//!
//! This module contains wide string slices and related types.
+use crate::utfstr::Lines;
#[cfg(feature = "alloc")]
use crate::{
error::{Utf16Error, Utf32Error},
@@ -910,6 +911,59 @@ p... | 3 | 307 | 0 |
146a340fd0f04da8a3449ccb912c30ad5a9bcb79 | Kathryn Long | 2024-04-06T21:45:46 | Fix Cargo lockfile for 1.58.1 CI | diff --git a/Cargo.lock b/Cargo.lock
index 40d266c..31a0d36 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -4,9 +4,9 @@ version = 3
[[package]]
name = "aho-corasick"
-version = "1.1.3"
+version = "0.7.20"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "8e60d3430d3a69478ad0993f19238d2df97... | 1 | 8 | 20 |
cb51bfe73731bccfc6cc1de66edad22ce0262d8d | Kathryn Long | 2024-04-06T21:21:48 | Fix more redundant imports | diff --git a/src/ustring.rs b/src/ustring.rs
index c06d646..1473bc6 100644
--- a/src/ustring.rs
+++ b/src/ustring.rs
@@ -10,6 +10,7 @@
string::String,
vec::Vec,
};
+#[allow(unused_imports)]
use core::{
borrow::{Borrow, BorrowMut},
char, cmp,
diff --git a/src/utfstr.rs b/src/utfstr.rs
index d30c3f7... | 3 | 3 | 0 |
394f38806fb79e38c9851ccf43c45193b0e43e81 | Kathryn Long | 2024-04-06T21:17:37 | Fix more redundant import warnings | diff --git a/src/ustr/iter.rs b/src/ustr/iter.rs
index c5feb06..5bf8b08 100644
--- a/src/ustr/iter.rs
+++ b/src/ustr/iter.rs
@@ -2,6 +2,7 @@
error::{DecodeUtf16Error, DecodeUtf32Error},
iter::{DecodeUtf16, DecodeUtf16Lossy, DecodeUtf32, DecodeUtf32Lossy},
};
+#[allow(unused_imports)]
use core::{
iter::... | 4 | 4 | 0 |
5ef67a7de52f5fe59e0bf70b1bacdc3129f4a532 | Kathryn Long | 2024-04-06T21:08:50 | Fix clippy warning | diff --git a/src/lib.rs b/src/lib.rs
index 839db22..8aec808 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -220,6 +220,7 @@
trivial_numeric_casts,
future_incompatible
)]
+#![allow(renamed_and_removed_lints)] // Until min version gets bumped to after rename
#![cfg_attr(not(feature = "std"), no_std)]
#![doc(htm... | 1 | 1 | 0 |
b4f9d67546753a09a5230161e26bc0cf475b2622 | John Watson | 2022-11-29T19:44:37 | fix U32 from_str_truncate comments | diff --git a/src/ucstring.rs b/src/ucstring.rs
index 143666e..173c4a9 100644
--- a/src/ucstring.rs
+++ b/src/ucstring.rs
@@ -1381,7 +1381,7 @@ pub unsafe fn from_str_unchecked(s: impl AsRef<str>) -> Self {
Self::from_chars_unchecked(v)
}
- /// Constructs a [`U16CString`] copy from a [`str`], encoding... | 1 | 2 | 2 |
113478c191deace5b10c8b5c9e29fc8678b43250 | clubby789 | 2022-09-10T11:12:37 | `rustfmt` | diff --git a/src/ucstring.rs b/src/ucstring.rs
index 11c6274..143666e 100644
--- a/src/ucstring.rs
+++ b/src/ucstring.rs
@@ -10,7 +10,8 @@
};
use core::{
borrow::{Borrow, BorrowMut},
- cmp, mem::{self, ManuallyDrop},
+ cmp,
+ mem::{self, ManuallyDrop},
ops::{Deref, DerefMut, Index},
ptr,
... | 1 | 2 | 1 |
e084b5c7298d9ab8dcdac923da09856dec09d0d8 | OpenByte | 2022-06-22T19:41:59 | Add prefix to local variables in macros | diff --git a/src/macros.rs b/src/macros.rs
index 22a0b1a..8214ecd 100644
--- a/src/macros.rs
+++ b/src/macros.rs
@@ -9,23 +9,23 @@ macro_rules! $name {
$crate::internals::length_as_utf16(_WIDESTRING_U16_MACRO_UTF8) + $extra_len;
const _WIDESTRING_U16_MACRO_UTF16: [$crate::internals... | 1 | 21 | 21 |
7b735ff7adcf3f4b086d6c55fa66c85bf1255cf4 | OpenByte | 2022-06-22T19:41:19 | Use fully qualified type names in macros | diff --git a/src/macros.rs b/src/macros.rs
index 43355e6..22a0b1a 100644
--- a/src/macros.rs
+++ b/src/macros.rs
@@ -9,10 +9,10 @@ macro_rules! $name {
$crate::internals::length_as_utf16(_WIDESTRING_U16_MACRO_UTF8) + $extra_len;
const _WIDESTRING_U16_MACRO_UTF16: [$crate::internals... | 1 | 4 | 4 |
ce34973f7490c2df1c14f94ed09710206cffd8bf | Scallop Ye | 2022-05-07T05:30:46 | Update utfstr.rs | diff --git a/src/utfstr.rs b/src/utfstr.rs
index 444de29..52e64de 100644
--- a/src/utfstr.rs
+++ b/src/utfstr.rs
@@ -152,18 +152,9 @@ pub const fn as_ptr(&self) -> *const $uchar {
/// Converts a mutable string slice to a mutable pointer.
///
/// This pointer will be pointing to th... | 1 | 1 | 10 |
2df64cb0aebd21790f28cc29d534b9e4a0b00034 | Scallop Ye | 2022-05-07T05:29:44 | Update ucstr.rs | diff --git a/src/ucstr.rs b/src/ucstr.rs
index 934d158..60907ae 100644
--- a/src/ucstr.rs
+++ b/src/ucstr.rs
@@ -571,14 +571,9 @@ pub const fn as_ptr(&self) -> *const $uchar {
///
/// Modifying the container referenced by this string may cause its buffer to be
/// reallocated, whi... | 1 | 2 | 12 |
14c68a0f60811460247a083632ce16ab48f0778e | Kathryn Long | 2021-11-29T15:03:09 | remove duplicate attribute | diff --git a/src/utfstr.rs b/src/utfstr.rs
index 05b430b..f3c49f9 100644
--- a/src/utfstr.rs
+++ b/src/utfstr.rs
@@ -1964,7 +1964,6 @@ pub fn to_lowercase(&self) -> Utf32String {
/// Since some characters can expand into multiple characters when changing the case, this
/// function returns a [`Utf32String`] i... | 1 | 0 | 1 |
a81b7d85bafbf939f61eb4a4c7ba9d43c59f222c | Kathryn Long | 2021-11-05T21:52:51 | fix clippy warning in unreleased rust versions | diff --git a/src/lib.rs b/src/lib.rs
index d0d42f2..b0ecce0 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -637,7 +637,7 @@ fn validate_utf32_vec(v: Vec<u32>) -> Result<Vec<u32>, crate::error::Utf32Error>
/// Copy of unstable core::slice::range to soundly handle ranges
/// TODO: Replace with core::slice::range when it i... | 1 | 1 | 1 |
f8116513075631b8861186bc9ebcd22975ee4f23 | Kathryn Long | 2021-11-05T21:47:10 | fix dead code warning on no-std | diff --git a/src/lib.rs b/src/lib.rs
index a589676..d0d42f2 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -637,6 +637,7 @@ fn validate_utf32_vec(v: Vec<u32>) -> Result<Vec<u32>, crate::error::Utf32Error>
/// Copy of unstable core::slice::range to soundly handle ranges
/// TODO: Replace with core::slice::range when it i... | 1 | 1 | 0 |
b4fbd416576e5d9e7c6ed78aa4adb0692dfc3f76 | Kathryn Long | 2021-11-03T14:16:49 | retain original vector in UtfString errors | diff --git a/src/error.rs b/src/error.rs
index 72f6c0b..d9707e9 100644
--- a/src/error.rs
+++ b/src/error.rs
@@ -139,6 +139,9 @@ pub fn nul_position(&self) -> usize {
/// Consumes this error, returning the underlying vector of values which generated the error in
/// the first place.
+ ///
+ /// If the... | 4 | 111 | 16 |
117e0cb88a9e53176951a12464955af30aa9df32 | Kathryn Long | 2021-11-01T22:08:05 | fix no_std compile | diff --git a/src/error.rs b/src/error.rs
index 331de16..72f6c0b 100644
--- a/src/error.rs
+++ b/src/error.rs
@@ -3,6 +3,8 @@
#[cfg(feature = "alloc")]
use alloc::vec::Vec;
+#[cfg(feature = "alloc")]
+#[cfg_attr(docsrs, doc(cfg(feature = "alloc")))]
#[doc(no_inline)]
pub use alloc::string::FromUtf16Error;
#[doc(n... | 5 | 35 | 13 |
058824ca2a411ab66a363e4bbe9cd2dcc34650a4 | Kathryn Long | 2021-10-25T22:55:14 | minor doc fix | diff --git a/src/macros.rs b/src/macros.rs
index a3ba423..a457a57 100644
--- a/src/macros.rs
+++ b/src/macros.rs
@@ -35,7 +35,7 @@ macro_rules! $name {
}
implement_utf16_macro! {
- /// Converts string literal into a `const` UTF-16 string slice of type
+ /// Converts a string literal into a `const` UTF-16 stri... | 1 | 4 | 4 |
11082a6d9bb229cbabcd47a3f7757aa91d7729ec | Kathryn Long | 2021-10-25T22:39:38 | minor doc fix | diff --git a/src/macros.rs b/src/macros.rs
index d6648fb..a3ba423 100644
--- a/src/macros.rs
+++ b/src/macros.rs
@@ -121,7 +121,7 @@ macro_rules! $name {
implement_utf32_macro! {
/// Converts string literal into a `const` UTF-32 string slice of type
- /// [`U32Str`][crate::U32Str].
+ /// [`U32CStr`][crate... | 1 | 5 | 5 |
869a02625d3b3e11296f8d466631b219b6aa7062 | Kathryn Long | 2021-10-25T22:36:14 | fix macro doc tests in no-std | diff --git a/src/macros.rs b/src/macros.rs
index 77229fd..d6648fb 100644
--- a/src/macros.rs
+++ b/src/macros.rs
@@ -43,10 +43,12 @@ macro_rules! $name {
/// # Examples
///
/// ```
+ /// # #[cfg(feature = "alloc")] {
/// use widestring::{u16str, U16Str, U16String};
///
/// const STRING:... | 1 | 8 | 0 |
a6c928e1f34132a0961c9397d188d447c854100d | Kathryn Long | 2021-10-25T22:26:50 | fix macro test for no-std | diff --git a/src/macros.rs b/src/macros.rs
index 5d3dd15..77229fd 100644
--- a/src/macros.rs
+++ b/src/macros.rs
@@ -228,7 +228,7 @@ pub const fn length_as_utf32(s: &str) -> usize {
}
}
-#[cfg(test)]
+#[cfg(all(test, feature = "alloc"))]
mod test {
use crate::{
U16CStr, U16Str, U16String, U32CStr... | 1 | 1 | 1 |
86620d95b4312c5a048fffbbddb3ea6f189b6adb | Kathryn Long | 2021-10-23T18:19:41 | fix recent changes for no-std | diff --git a/src/ustr.rs b/src/ustr.rs
index 9a4de05..7a38d31 100644
--- a/src/ustr.rs
+++ b/src/ustr.rs
@@ -637,7 +637,7 @@ pub fn to_string(&self) -> Result<String, crate::error::FromUtf32Error> {
return Err(crate::error::FromUtf32Error::new());
}
let size = chars.iter().filter_map(|o| ... | 1 | 2 | 2 |
143a624771d5a41e6ee22a52843ca63d47495c58 | Kathryn Long | 2021-10-23T17:57:34 | 0-length vectors no longer panic from_vec. Fixes #22 | diff --git a/src/ucstring.rs b/src/ucstring.rs
index 04e98e8..24083ea 100644
--- a/src/ucstring.rs
+++ b/src/ucstring.rs
@@ -94,6 +94,20 @@ impl<C: UChar> UCString<C> {
/// # assert_eq!(wcstr.into_vec(), cloned);
/// ```
///
+ /// Empty vectors are valid and will return an empty string with a nul term... | 1 | 16 | 1 |
8d4544d430439aaaf47bc9681f11a5a288967b86 | Kathryn Long | 2021-10-12T22:12:43 | fix clippy warning in test | diff --git a/src/ustring.rs b/src/ustring.rs
index 514af97..8a5987d 100644
--- a/src/ustring.rs
+++ b/src/ustring.rs
@@ -1462,6 +1462,7 @@ mod test {
use super::*;
#[test]
+ #[allow(clippy::write_literal)]
fn number_to_string() {
let mut s = U16String::new();
write!(s, "{}", 1234).... | 1 | 1 | 0 |
45f4daf596211bb2995a32d0ae7062313984415d | Kathryn Long | 2021-10-12T21:53:20 | fix doc links. again | diff --git a/src/iter.rs b/src/iter.rs
index 0a6f7c2..2e47142 100644
--- a/src/iter.rs
+++ b/src/iter.rs
@@ -108,7 +108,7 @@ impl<I> FusedIterator for DecodeUtf32Lossy<I> where I: Iterator<Item = u32> + Fu
/// An iterator over decoded [`char`][prim@char]s of a string slice.
///
-/// This struct is created by the [`... | 1 | 5 | 5 |
3df2dee2bdcec3859840de93da8290506c661c2c | Kathryn Long | 2021-10-12T21:51:24 | fix doc links on msrv 1.48 | diff --git a/src/iter.rs b/src/iter.rs
index 9abc04e..0a6f7c2 100644
--- a/src/iter.rs
+++ b/src/iter.rs
@@ -108,7 +108,7 @@ impl<I> FusedIterator for DecodeUtf32Lossy<I> where I: Iterator<Item = u32> + Fu
/// An iterator over decoded [`char`][prim@char]s of a string slice.
///
-/// This struct is created by the [`... | 1 | 5 | 5 |
525e1b0b21acbca9027b37929603c167e060f3de | Kathryn Long | 2021-10-12T21:44:16 | fix no default feature errors | diff --git a/src/iter.rs b/src/iter.rs
index 9b71553..9abc04e 100644
--- a/src/iter.rs
+++ b/src/iter.rs
@@ -146,7 +146,7 @@ fn size_hint(&self) -> (usize, Option<usize>) {
impl<'a> FusedIterator for Utf16Chars<'a> {}
impl<'a> core::fmt::Debug for Utf16Chars<'a> {
- fn fmt(&self, f: &mut std::fmt::Formatter<'_>)... | 5 | 15 | 7 |
790fbf930015192c46739d5c76fa55e058e38d9a | Kathryn Long | 2021-10-12T21:35:01 | fix msrv error | diff --git a/src/ustring.rs b/src/ustring.rs
index 13e3b79..633f27e 100644
--- a/src/ustring.rs
+++ b/src/ustring.rs
@@ -480,7 +480,12 @@ pub fn pop(&mut self) -> Option<u32> {
if crate::is_utf16_high_surrogate(high) {
self.inner.pop();
let buf = [h... | 1 | 6 | 1 |
15e31944b183b72cfc6ad05ab600a4c3f02768b1 | Kathryn Long | 2021-10-12T21:31:36 | fix clippy warnings | diff --git a/src/lib.rs b/src/lib.rs
index ccccb78..9fcdad3 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -436,15 +436,15 @@ fn debug_fmt_utf32_iter(
#[inline(always)]
fn is_utf16_surrogate(u: u16) -> bool {
- u >= 0xD800 && u <= 0xDFFF
+ (0xD800..=0xDFFF).contains(&u)
}
#[inline(always)]
fn is_utf16_high_... | 3 | 3 | 13 |
fcba9d7b383c5f57e97a995fecded9650d882127 | Kathryn Long | 2021-10-09T08:03:21 | fix dead code warning in no-default-features | diff --git a/src/error.rs b/src/error.rs
index d08e3f7..9953643 100644
--- a/src/error.rs
+++ b/src/error.rs
@@ -156,6 +156,7 @@ pub struct FromUtf32Error {
}
impl FromUtf32Error {
+ #[allow(dead_code)]
pub(crate) fn new() -> Self {
Self { _unused: () }
} | 1 | 1 | 0 |
de4acebb1b297a0760276164656856f3914d7cc0 | Kathryn Long | 2021-10-08T02:31:02 | add private fields to some errors to prevent pub construction | diff --git a/src/error.rs b/src/error.rs
index 3d0a6e7..d11b5dc 100644
--- a/src/error.rs
+++ b/src/error.rs
@@ -66,7 +66,15 @@ fn from(value: ContainsNull<C>) -> Self {
/// An error returned from to indicate that a terminating null value was missing
#[derive(Debug, Clone)]
-pub struct MissingNullTerminator;
+pub s... | 3 | 23 | 7 |
3037bc922ab28027c4234b4c4bfafab9d1f1cf4f | Kathryn Long | 2021-10-08T02:21:48 | fix doctest on msrv 1.48 | diff --git a/src/lib.rs b/src/lib.rs
index 74565b8..15f5fb4 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -319,7 +319,7 @@ pub fn decode_utf16_lossy<I>(iter: I) -> iter::DecodeUtf16Lossy<<I as IntoIterat
/// ];
///
/// assert_eq!(
-/// decode_utf32(v)
+/// decode_utf32(v.iter().copied())
/// .map(|r| ... | 1 | 1 | 1 |
3fb4804661cc5ad54b00f5d3720da37ba835c648 | Kathryn Long | 2021-10-08T02:12:39 | fix for msrv unstable char features | diff --git a/src/iter.rs b/src/iter.rs
index 254ddfa..25330d1 100644
--- a/src/iter.rs
+++ b/src/iter.rs
@@ -26,7 +26,7 @@ impl<I> Iterator for DecodeUtf16Lossy<I>
fn next(&mut self) -> Option<Self::Item> {
self.iter
.next()
- .map(|res| res.unwrap_or(char::REPLACEMENT_CHARACTER))
... | 3 | 7 | 7 |
5bf0cf465bdcdfa707f14573c8890bdfacfde0e6 | Kathryn Long | 2021-10-08T01:58:49 | fix some std::fmt to be core::fmt | diff --git a/src/error.rs b/src/error.rs
index 35eb255..3d0a6e7 100644
--- a/src/error.rs
+++ b/src/error.rs
@@ -184,7 +184,7 @@ pub fn invalid_code_point(&self) -> u32 {
}
impl core::fmt::Display for DecodeUtf32Error {
- fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
+ fn fmt(&self, f: ... | 5 | 13 | 13 |
932b48331d7974f2ec787182124678ac2e32fc92 | Kathryn Long | 2021-09-14T19:42:52 | make UChar trait sealed | diff --git a/Cargo.toml b/Cargo.toml
index 1962e51..0918d08 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -1,5 +1,6 @@
[package]
name = "widestring"
+# Remember to keep in sync with html_root_url crate attribute
version = "0.5.0-dev"
authors = ["Kathryn Long <squeeself@gmail.com>"]
description = "A wide string FFI l... | 2 | 12 | 4 |
d8188a1e41ecf312252906fec8c9d1bfc4a2dc01 | Kathryn Long | 2021-09-14T01:50:30 | fix broken windows doctest | diff --git a/src/lib.rs b/src/lib.rs
index 3500149..6008cd5 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -139,7 +139,7 @@
//! LocalFree(buffer as HLOCAL);
//! }
//! // Convert to a regular Rust String and use it to your heart's desire!
-//! let message = U16Str.to_string_lossy();
+//! let message = s.to_string_lo... | 1 | 2 | 2 |
769d748b8779c5c10254ad044963a0a1c1c766b3 | Kathryn Long | 2021-09-14T01:47:22 | fix warning in windows test | diff --git a/src/lib.rs b/src/lib.rs
index 6df0dbc..3500149 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -118,7 +118,7 @@
//! # use winapi::shared::minwindef::DWORD;
//! # let error_code: DWORD = 0;
//!
-//! let U16Str: U16String;
+//! let s: U16String;
//! unsafe {
//! // First, get a string buffer from some w... | 1 | 4 | 4 |
adc0002b0b9a51de0a42127f7dc91c8bd689cf81 | Kathryn Long | 2021-09-14T01:42:59 | deny most doctest warnings | diff --git a/src/lib.rs b/src/lib.rs
index 90a1254..6df0dbc 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -202,6 +202,7 @@
)]
#![cfg_attr(not(feature = "std"), no_std)]
#![doc(html_root_url = "https://docs.rs/widestring/")]
+#![doc(test(attr(deny(warnings), allow(unused))))]
#![cfg_attr(docsrs, feature(doc_cfg))]
... | 1 | 1 | 0 |
c63465c69eee013c9555b4571a04b92c4fae81a2 | Kathryn Long | 2021-09-14T01:35:03 | fix from_slice/vec check and doctest warnings | diff --git a/src/ucstr.rs b/src/ucstr.rs
index 7e36245..4f76a24 100644
--- a/src/ucstr.rs
+++ b/src/ucstr.rs
@@ -202,7 +202,10 @@ pub fn from_slice(slice: &[C]) -> Result<&Self, NullError<C>> {
if slice.last() != Some(&UChar::NULL) {
return Err(MissingNullTerminator.into());
}
- ma... | 2 | 22 | 19 |
81187cd1a5bf4df0322cd7abf40d5145b9dee2b3 | Kathryn Long | 2021-09-12T06:34:24 | fix another broken doctest on windows no_std. added docsrs doc(cfg) annotations | diff --git a/src/lib.rs b/src/lib.rs
index fae48d6..939384f 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -94,11 +94,11 @@
//! functions so we don't need to worry about nul values.
//!
//! ```rust
-//! # #[cfg(not(windows))]
+//! # #[cfg(any(not(windows), not(feature = "alloc")))]
//! # fn main() {}
//! # extern cra... | 5 | 36 | 2 |
57ba47dbcbfe517551a778053aa9c7aa422b4656 | Kathryn Long | 2021-09-12T06:01:56 | fix test on windows no_std | diff --git a/src/lib.rs b/src/lib.rs
index 416c2c8..fae48d6 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -138,11 +138,11 @@
//! The following example is the functionally the same, only using `U16CString` instead.
//!
//! ```rust
-//! # #[cfg(not(windows))]
+//! # #[cfg(any(not(windows), not(feature = "alloc")))]
//!... | 1 | 2 | 2 |
eb6b003fbad5931ddcbfc803f219d07c1b6405d0 | joshwd36 | 2020-10-04T10:13:43 | Fix undefined behaviour with transmuting between vectors, and fix clippy lints. | diff --git a/src/ucstr.rs b/src/ucstr.rs
index 6c0bdcb..5dbbf16 100644
--- a/src/ucstr.rs
+++ b/src/ucstr.rs
@@ -1,5 +1,5 @@
use crate::{UChar, WideChar};
-use core::{mem, slice};
+use core::slice;
#[cfg(all(feature = "alloc", not(feature = "std")))]
use alloc::{
@@ -112,9 +112,10 @@ pub unsafe fn from_ptr_str<'a>... | 4 | 83 | 27 |
364b5d5d079fdddbfc509ad810b882893b867fd5 | kpcyrd | 2019-04-27T14:18:03 | Fix typo in description | diff --git a/Cargo.toml b/Cargo.toml
index 573e172..6c95989 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -2,7 +2,7 @@
name = "widestring"
version = "0.4.0"
authors = ["Kathryn Long <squeeself@gmail.com>"]
-description = "A wide string FFI library for converting to and from wide strings, such as those often used in Wi... | 1 | 2 | 2 |
342db0467e2d7da50d9982f5a2349428ac5aa162 | Kathryn Long | 2018-08-18T06:32:25 | removed keywords | diff --git a/Cargo.toml b/Cargo.toml
index 672dc2e..573e172 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -5,7 +5,7 @@ authors = ["Kathryn Long <squeeself@gmail.com>"]
description = "A wide string FFI library for converting to and from wide strings, such as those often used in Windows API or other FFI libaries. Both UTF... | 1 | 1 | 1 |
8b7aa59de0eefe0af5d90ccbcfe4e37aca337d76 | Kathryn Long | 2018-08-06T06:40:48 | add WideString type aliases | diff --git a/src/lib.rs b/src/lib.rs
index 9f5fee0..af72072 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -68,6 +68,18 @@
//! points are reserved only for 21-bits. Again, Unicode code points do not have a one-to-one
//! mapping with the concept of a visual character glyph.
//!
+//! # FFI with C/C++ `wchar_t`
+//!
+//!... | 1 | 44 | 0 |
9dfeffd509a4235a9e3f27f5b4672187b9e614c7 | Kathryn Long | 2018-08-05T22:13:19 | refactor strings into ffi module | diff --git a/src/ffi/mod.rs b/src/ffi/mod.rs
new file mode 100644
index 0000000..85a217e
--- /dev/null
+++ b/src/ffi/mod.rs
@@ -0,0 +1,157 @@
+//! A wide string FFI module for converting to and from Wide "Unicode" strings.
+//!
+//! This module provides two types of wide strings: `WideString` and `WideCString`. They di... | 4 | 197 | 42 |
3c65792d481e75a009f73e07c93bfe1f06e06311 | Kathryn Long | 2018-04-10T03:01:44 | add doctest for #7 | diff --git a/src/widecstring.rs b/src/widecstring.rs
index 616b1e8..f12b4ad 100644
--- a/src/widecstring.rs
+++ b/src/widecstring.rs
@@ -770,6 +770,22 @@ pub fn to_os_string(&self) -> OsString {
/// Copies the wide string to a new owned `WideString`.
///
/// The `WideString` will **not** have a nul termi... | 1 | 16 | 0 |
e4ff6b2adcecc70ffab4f41fcb4309a0018cd20d | Kathryn Long | 2018-03-17T22:50:33 | minor cleanup to docs and rustfmt | diff --git a/src/lib.rs b/src/lib.rs
index 139d639..9dabc26 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -1,18 +1,18 @@
-//! A wide string FFI library for converting to and from Windows Wide "Unicode" strings.
+//! A wide string FFI library for converting to and from Wide "Unicode" strings.
//!
//! This crate provides... | 5 | 59 | 60 |
17f53673251cd06bc27910c3fcbc528dc632c8d8 | Kathryn Long | 2018-02-03T22:48:22 | fix package version | diff --git a/Cargo.toml b/Cargo.toml
index 58cee81..e2190b1 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -1,6 +1,6 @@
[package]
name = "widestring"
-version = "0.3"
+version = "0.3.0"
authors = ["Kathryn Long <squeeself@gmail.com>"]
description = "A wide string FFI library for converting to and from Wide \"Unicode\"... | 1 | 1 | 1 |
496eb49e6ea78d8a120ec0e583de625bf3cfa40b | Kathryn Long | 2018-02-03T03:49:38 | bump version | diff --git a/Cargo.toml b/Cargo.toml
index 509ccaa..58cee81 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -1,6 +1,6 @@
[package]
name = "widestring"
-version = "0.2.2"
+version = "0.3"
authors = ["Kathryn Long <squeeself@gmail.com>"]
description = "A wide string FFI library for converting to and from Wide \"Unicode\"... | 1 | 1 | 1 |
8188f791e6d51a411570f7e168db932c6e6291c9 | Kathryn Long | 2018-02-03T03:49:04 | add cargo categories and badges | diff --git a/Cargo.toml b/Cargo.toml
index c2f253c..509ccaa 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -6,7 +6,13 @@ description = "A wide string FFI library for converting to and from Wide \"Unico
repository = "https://github.com/starkat99/widestring-rs.git"
readme = "README.md"
keywords = ["windows", "wide", "str... | 1 | 6 | 0 |
dfa570f57f5275599e4502cc88fdc3e12cb2eae1 | Mark Summerfield | 2018-02-27T08:34:29 | Mostly corrected spellings of null and guarantee
Plus some v. small textual improvements. | diff --git a/src/lib.rs b/src/lib.rs
index 3d8edf5..139d639 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -1,39 +1,39 @@
//! A wide string FFI library for converting to and from Windows Wide "Unicode" strings.
//!
//! This crate provides two types of wide strings: `WideString` and `WideCString`. They differ
-//! in th... | 1 | 20 | 20 |
db01f7654f60464da8d94f33a14662e8b9c6cb4a | Kathryn Long | 2018-02-03T03:12:48 | fix module doctests on windows | diff --git a/src/lib.rs b/src/lib.rs
index cbaf428..3d8edf5 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -71,9 +71,13 @@
//! # extern crate widestring;
//! # #[cfg(windows)]
//! # fn main() {
-//! use winapi::um::winbase::{FormatMessageW, LocalFree};
+//! use winapi::um::winbase::{FormatMessageW, LocalFree, FORMAT_ME... | 1 | 10 | 2 |
0c98740417647c33a1bbf2b32238f7ff3cee2eff | Kathryn Long | 2018-02-03T02:01:01 | add more _unchecked functions | diff --git a/src/widecstring.rs b/src/widecstring.rs
index 517e3d2..763d5c0 100644
--- a/src/widecstring.rs
+++ b/src/widecstring.rs
@@ -152,9 +152,9 @@ pub fn from_vec_with_nul<T: Into<Vec<u16>>>(v: T) -> Result<WideCString, Missing
///
/// # Safety
///
- /// This method is equivalent to `from_vec` e... | 1 | 149 | 11 |
e31649966df071016e99d773096753f037b02730 | Kathryn Long | 2018-02-03T00:57:00 | add WideCStr default | diff --git a/src/widecstring.rs b/src/widecstring.rs
index 55c6aba..517e3d2 100644
--- a/src/widecstring.rs
+++ b/src/widecstring.rs
@@ -23,7 +23,7 @@
/// use widestring::WideCString;
/// let v = vec![84u16, 104u16, 101u16]; // 'T' 'h' 'e'
/// // Create a wide string from the vector
-/// let wstr = WideCString::from... | 1 | 10 | 4 |
4bc38776a483b6523335f7793c354ed564bb14f1 | Kathryn Long | 2018-02-03T00:54:30 | renamed from_vec to replace new | diff --git a/src/widecstring.rs b/src/widecstring.rs
index 73a51b6..55c6aba 100644
--- a/src/widecstring.rs
+++ b/src/widecstring.rs
@@ -62,14 +62,7 @@ pub struct WideCStr {
pub struct MissingNulError(Option<Vec<u16>>);
impl WideCString {
- /// Constructs a new empty `WideCString`.
- pub fn new() -> WideCStri... | 1 | 12 | 17 |
7335c5936f14f860115da2bc680e8967ebdb645e | Kathryn Long | 2018-02-02T04:14:43 | fix move out of drop struct error | diff --git a/src/widecstring.rs b/src/widecstring.rs
index 03c5d5b..73a51b6 100644
--- a/src/widecstring.rs
+++ b/src/widecstring.rs
@@ -381,7 +381,7 @@ pub fn as_wide_c_str(&self) -> &WideCStr {
/// The resulting vector will **not** contain a nul-terminator, and will contain no other nul
/// values.
pub... | 1 | 14 | 3 |
a4d97c8af5e2d695b36925484e09adbd43bd6e11 | Kathryn Long | 2018-02-02T04:10:23 | add Drop impl to WideCString | diff --git a/src/widecstring.rs b/src/widecstring.rs
index f6800c5..03c5d5b 100644
--- a/src/widecstring.rs
+++ b/src/widecstring.rs
@@ -479,6 +479,18 @@ fn default() -> WideCString {
}
}
+// Turns this `WideCString` into an empty string to prevent
+// memory unsafe code from working by accident. Inline
+// to ... | 1 | 12 | 0 |
77a04d7e6495f408759bcbc3f33f3581e072126d | Kathryn Long | 2018-02-02T04:01:02 | add shrink_to_fit | diff --git a/src/widestring.rs b/src/widestring.rs
index a2a636c..23ea3ea 100644
--- a/src/widestring.rs
+++ b/src/widestring.rs
@@ -224,6 +224,25 @@ pub fn push_slice<T: AsRef<[u16]>>(&mut self, s: T) {
pub fn push_str<T: AsRef<OsStr>>(&mut self, s: T) {
self.inner.extend(platform::os_to_wide(s.as_ref())... | 1 | 19 | 0 |
aed55f612bfe47d32e6ef5548ef134cf0f781727 | Kathryn Long | 2018-02-02T02:07:44 | ran latest rustfmt | diff --git a/src/widecstring.rs b/src/widecstring.rs
index b341401..f6800c5 100644
--- a/src/widecstring.rs
+++ b/src/widecstring.rs
@@ -1,7 +1,7 @@
use std;
use std::mem;
use super::{WideStr, WideString};
-use std::ffi::{OsString, OsStr};
+use std::ffi::{OsStr, OsString};
use super::platform;
/// An owned, muta... | 2 | 21 | 10 |
3c4d2f38a382f3629c0e7eca59286597e1391579 | Kathryn Long | 2018-02-02T02:05:09 | update winapi dev dependency | diff --git a/Cargo.toml b/Cargo.toml
index a4b13a3..c2f253c 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -9,5 +9,4 @@ keywords = ["windows", "wide", "string", "win32", "utf16"]
license = "MIT/Apache-2.0"
[dev-dependencies]
-winapi = "0.2.5"
-kernel32-sys = "0.2.1"
\ No newline at end of file
+winapi = { version = "0... | 2 | 7 | 18 |
e6c8be765ea4538377ee0547d5ad57692f60eb12 | Kang Seonghoon | 2016-09-05T17:00:54 | Make `WideCString::into_raw` to correctly forget the original self. | diff --git a/src/widecstring.rs b/src/widecstring.rs
index 593fb12..b341401 100644
--- a/src/widecstring.rs
+++ b/src/widecstring.rs
@@ -398,8 +398,7 @@ pub fn into_vec_with_nul(self) -> Vec<u16> {
///
/// Failure to call `from_raw` will lead to a memory leak.
pub fn into_raw(self) -> *mut u16 {
- ... | 1 | 1 | 2 |
651f3fe59a0d3754d3458322a6b7fe6fb0ec0dc9 | Kathryn Long | 2016-08-12T01:22:29 | feat(WideCString): implement into_raw/from_raw
Closes #2 | diff --git a/src/widecstring.rs b/src/widecstring.rs
index c31994d..593fb12 100644
--- a/src/widecstring.rs
+++ b/src/widecstring.rs
@@ -30,7 +30,7 @@
/// ```
#[derive(Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
pub struct WideCString {
- inner: Vec<u16>,
+ inner: Box<[u16]>,
}
/// C-style wide st... | 1 | 40 | 9 |
adb7dbdffd4b9d0551d75dbe7d9cde3388bfbd52 | Kathryn Long | 2016-08-12T00:03:07 | refactor(WideCString): use `Into<Vec>>` on unchecked functions | diff --git a/src/widecstring.rs b/src/widecstring.rs
index 8ee5e6f..c31994d 100644
--- a/src/widecstring.rs
+++ b/src/widecstring.rs
@@ -160,8 +160,8 @@ pub fn from_vec_with_nul<T: Into<Vec<u16>>>(v: T) -> Result<WideCString, Missing
/// This method is equivalent to `from_vec` except that no runtime assertion is m... | 1 | 5 | 5 |
cbe9a736131d1b6384bd01a70943574f13bb56c4 | Kathryn Long | 2016-05-31T06:45:55 | style: fix comment line length | diff --git a/src/widecstring.rs b/src/widecstring.rs
index e1988ba..8ee5e6f 100644
--- a/src/widecstring.rs
+++ b/src/widecstring.rs
@@ -8,8 +8,8 @@
///
/// `WideCString` is aware of nul values. Unless unchecked conversions are used, all `WideCString`
/// strings end with a nul-terminator in the underlying buffer, a... | 1 | 2 | 2 |
7bc687f8d4ddbeefe626155b10564da950f50eea | Kathryn Long | 2016-05-31T05:59:56 | feat: add methods & traits to bring to parity with Rust 1.9 string APIs
add capacity/reserve functions to WideString that were added to OsString in 1.9, and rename unit_length() functions back to len() to match Rust string style | diff --git a/src/widecstring.rs b/src/widecstring.rs
index a734f9f..e1988ba 100644
--- a/src/widecstring.rs
+++ b/src/widecstring.rs
@@ -607,7 +607,7 @@ pub fn to_string_lossy(&self) -> String {
///
/// The slice will **not** include the nul terminator.
pub fn as_slice(&self) -> &[u16] {
- &self.i... | 2 | 83 | 6 |
14837b162a2a24edd120592dbc7f873591a3fc73 | Kathryn Long | 2016-05-31T05:47:20 | doc(crate): further clarify different string relationships | diff --git a/src/lib.rs b/src/lib.rs
index 7ce07fc..14c274e 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -29,20 +29,22 @@
//! `OsString` and `OsStr` are also strings for use with FFI. Unlike `CString`, they do no special
//! handling of nul values, but instead have an OS-specified encoding. While, for example, Linux
... | 1 | 10 | 8 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.