Avril 4 years ago
parent 410d6e859b
commit e97adfec1d
Signed by: flanchan
GPG Key ID: 284488987C31F630

@ -156,6 +156,7 @@ impl<T> VecExt<T> for Vec<T>
Err(e) => { Err(e) => {
// memory at (location+sent)..slen is now invalid, move the old one back before allowing unwind to contine // memory at (location+sent)..slen is now invalid, move the old one back before allowing unwind to contine
libc::memmove(this.add(sent) as *mut libc::c_void, this.add(slen) as *mut libc::c_void, rest); libc::memmove(this.add(sent) as *mut libc::c_void, this.add(slen) as *mut libc::c_void, rest);
self.set_len(len + sent);
std::panic::resume_unwind(e) std::panic::resume_unwind(e)
}, },
_ => (), _ => (),

@ -7,9 +7,23 @@ pub use global::*;
mod local; mod local;
pub use local::*; pub use local::*;
#[derive(Debug)]
/// An open or closed post /// An open or closed post
pub enum Post pub enum Post
{ {
Open(Imouto), Open(Imouto),
Closed(post::Static), Closed(post::Static),
} }
impl Post
{
/// Is this post open
#[inline] pub fn is_open(&self) -> bool
{
if let Self::Open(_) = self {
true
} else {
false
}
}
}

Loading…
Cancel
Save