mirror of
https://seed.radicle.dev/rad:z4V1sjrXqjvFdnCUbxPFqd5p4DtH5.git
synced 2026-11-28 17:50:28 +08:00
Handle json! panick trying to serialize non utf8 lines
Instead of panicking when trying to handle non utf8 lines we should return `null` as line output. This way we can on the frontend detect if a file has any lines the api wasn't able to parse and fallback to show a file as a `Binary File`
This commit is contained in:
@@ -12,7 +12,7 @@ pub(crate) enum Comment<'a> {
|
||||
Issue(&'a cob::thread::Comment),
|
||||
}
|
||||
|
||||
impl<'a> Comment<'a> {
|
||||
impl Comment<'_> {
|
||||
pub fn as_json(&self, id: &Oid, aliases: &impl AliasStore) -> Value {
|
||||
match self {
|
||||
Comment::Issue(c) => json!({
|
||||
|
||||
Reference in New Issue
Block a user