diff --git a/radicle-surf/src/source/commit.rs b/radicle-surf/src/source/commit.rs index 927718a..048a70b 100644 --- a/radicle-surf/src/source/commit.rs +++ b/radicle-surf/src/source/commit.rs @@ -47,7 +47,7 @@ pub struct Commit { } /// Representation of a code commit. -#[derive(Clone)] +#[derive(Clone, Debug)] pub struct Header { /// Identifier of the commit in the form of a sha1 hash. Often referred to /// as oid or object id. diff --git a/radicle-surf/src/source/object/blob.rs b/radicle-surf/src/source/object/blob.rs index c3f95ad..281ef93 100644 --- a/radicle-surf/src/source/object/blob.rs +++ b/radicle-surf/src/source/object/blob.rs @@ -103,7 +103,7 @@ impl Serialize for Blob { state.serialize_field("content", &self.content)?; state.serialize_field("lastCommit", &self.commit)?; state.serialize_field("name", &self.file.name())?; - state.serialize_field("path", &self.file.location())?; + state.serialize_field("path", &self.file.path())?; state.end() } } diff --git a/radicle-surf/src/source/object/tree.rs b/radicle-surf/src/source/object/tree.rs index ef70379..40e5a4b 100644 --- a/radicle-surf/src/source/object/tree.rs +++ b/radicle-surf/src/source/object/tree.rs @@ -33,6 +33,7 @@ use crate::{ }; /// Result of a directory listing, carries other trees and blobs. +#[derive(Clone, Debug)] pub struct Tree { pub directory: Directory, pub commit: Option, @@ -95,7 +96,7 @@ impl Serialize for Tree { state.serialize_field("entries", &self.entries)?; state.serialize_field("lastCommit", &self.commit)?; state.serialize_field("name", &self.directory.name())?; - state.serialize_field("path", &self.directory.location())?; + state.serialize_field("path", &self.directory.path())?; state.end() } } @@ -126,14 +127,14 @@ impl Serialize for TreeEntry { { const FIELDS: usize = 4; let mut state = serializer.serialize_struct("TreeEntry", FIELDS)?; - state.serialize_field("path", &self.entry.location())?; + state.serialize_field("path", &self.entry.path())?; state.serialize_field("name", &self.entry.name())?; state.serialize_field("lastCommit", &None::)?; state.serialize_field( "kind", match self.entry { directory::Entry::File(_) => "blob", - directory::Entry::Directory(_) => "directory", + directory::Entry::Directory(_) => "tree", }, )?; state.end()