git-next/crates/forge-forgejo/src/webhook/parser.rs

11 lines
257 B
Rust
Raw Normal View History

//
use crate as forgejo;
use git_next_core::{git, webhook};
pub fn parse_body(
body: &webhook::forge_notification::Body,
) -> git::forge::webhook::Result<webhook::Push> {
serde_json::from_str::<forgejo::webhook::Push>(body.as_str())?.try_into()
}