mirror of
https://github.com/AppFlowy-IO/AppFlowy.git
synced 2024-08-30 18:12:39 +00:00
32bd0ffca2
* feat: add flowy-database2 * chore: config type option data * chore: impl type option * feat: config group * fix: group compile * feat: add sort * chore: setting * chore: insert with specific type * chore: custom group * chore: rename any map * chore: use group setting * chore: update * chore: open database event * chore: update database editor * chore: update * chore: update view editor * chore: update * chore: update view editor * chore: sort feat * chore: update handler * chore: update * chore: config handler event * feat: impl handlers * feat: impl handlers * chore: layout setting * feat: impl handlers * chore: remove flowy-folder ref * chore: integrate flowy-database2 * feat: get cell * chore: create database with data * chore: create view * chore: fix dart compile * fix: some bugs * chore: update * chore: merge develop * chore: fix warning * chore: integrate rocksdb * fix: rocksdb compile errros * fix: update cell * chore: update the bundle identifier * fix: create row * fix: switch to field * fix: duplicate grid * test: migrate tests * test: migrate tests * test: update test * test: migrate tests * chore: add patch
18 lines
318 B
Rust
18 lines
318 B
Rust
#[derive(Debug)]
|
|
pub struct NotEmptyStr(pub String);
|
|
|
|
impl NotEmptyStr {
|
|
pub fn parse(s: String) -> Result<Self, String> {
|
|
if s.trim().is_empty() {
|
|
return Err("Input string is empty".to_owned());
|
|
}
|
|
Ok(Self(s))
|
|
}
|
|
}
|
|
|
|
impl AsRef<str> for NotEmptyStr {
|
|
fn as_ref(&self) -> &str {
|
|
&self.0
|
|
}
|
|
}
|