prep for preview release

This commit is contained in:
Greg Johnston 2024-04-27 11:12:59 -04:00
parent 0148d92f48
commit 78e5a7ebc3
5 changed files with 23 additions and 24 deletions

View File

@ -34,7 +34,6 @@ members = [
# libraries
"meta",
"router",
"is_server",
"router_macro",
"any_error",
]

View File

@ -1,8 +0,0 @@
[package]
name = "is_server"
edition = "2021"
version.workspace = true
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[dependencies]

View File

@ -1,14 +0,0 @@
pub fn add(left: usize, right: usize) -> usize {
left + right
}
#[cfg(test)]
mod tests {
use super::*;
#[test]
fn it_works() {
let result = add(2, 2);
assert_eq!(result, 4);
}
}

View File

@ -1,6 +1,12 @@
[package]
name = "or_poisoned"
edition = "2021"
version.workspace = true
version = "0.1.0"
authors = ["Greg Johnston"]
license = "MIT"
readme = "../README.md"
repository = "https://github.com/leptos-rs/leptos"
description = "Unwrap std lock guards in a semantic way."
rust-version.workspace = true
[dependencies]

16
or_poisoned/README.md Normal file
View File

@ -0,0 +1,16 @@
Provides a simple trait that unwraps the locks provide by [`std::sync::RwLock`].
In every case, this is the same as calling `.expect("lock poisoned")`. However, it
does not use `.unwrap()` or `.expect()`, which makes it easier to distinguish from
other forms of unwrapping when reading code.
```rust
use or_poisoned::OrPoisoned;
use std::sync::RwLock;
let lock = RwLock::new(String::from("Hello!"));
let read = lock.read().or_poisoned();
// this is identical to
let read = lock.read().unwrap();
```