ignore dead code warnings

This commit is contained in:
glyph 2022-10-02 16:54:02 +01:00
parent 9e86212404
commit d7d4f0e6b3
8 changed files with 11 additions and 0 deletions

View File

@ -54,6 +54,7 @@ pub struct Post {
impl Post {
// Create a new instance of the Post struct. A default value of `false` is
// set for `read`.
#[allow(dead_code)]
pub fn new(
key: String,
text: String,
@ -135,6 +136,7 @@ impl Database {
/// Add a post to the database by inserting an instance of the Post struct
/// into the post tree.
#[allow(dead_code)]
pub fn add_post(&self, public_key: &str, post: Post) -> Result<Option<IVec>> {
let post_key = format!("{}_{}", public_key, post.key);
debug!("Serializing post data for {} to bincode", &post_key);
@ -146,6 +148,7 @@ impl Database {
/// Add a batch of posts to the database by inserting a vector of instances
/// of the Post struct into the post tree.
#[allow(dead_code)]
pub fn add_post_batch(&self, public_key: &str, posts: Vec<Post>) -> Result<()> {
let mut post_batch = Batch::default();

View File

@ -132,6 +132,7 @@ pub async fn unfollow_if_following(remote_peer: &str) -> Result<(), String> {
/// Return a stream of messages authored by the given public key.
///
/// This returns all messages regardless of type.
#[allow(dead_code)]
pub async fn get_message_stream(
public_key: &str,
sequence_number: u64,
@ -162,6 +163,7 @@ pub async fn get_name(public_key: &str) -> Result<String, String> {
/// Each returned vector element includes the key of the post, the content
/// text, the date the post was published, the sequence number of the post
/// and whether it is read or unread.
#[allow(dead_code)]
pub async fn get_root_posts(
history_stream: impl futures::Stream<Item = Result<SsbMessageKVT, GolgiError>>,
) -> (u64, Vec<Post>) {

View File

@ -155,6 +155,7 @@ impl Database {
/// Add a post to the database by inserting an instance of the Post struct
/// into the post tree.
#[allow(dead_code)]
pub fn add_post(&self, public_key: &str, post: Post) -> Result<Option<IVec>> {
let post_key = format!("{}_{}", public_key, post.key);
debug!("Serializing post data for {} to bincode", &post_key);

View File

@ -43,6 +43,7 @@ async fn fetch_name_and_update_db(db: &Database, peer_id: String) {
pub enum Task {
Cancel,
FetchAllPosts(String),
#[allow(dead_code)]
FetchLatestName(String),
}

View File

@ -176,6 +176,7 @@ impl Database {
/// Add a post to the database by inserting an instance of the Post struct
/// into the post tree.
#[allow(dead_code)]
pub fn add_post(&self, public_key: &str, post: Post) -> Result<Option<IVec>> {
let post_key = format!("{}_{}", public_key, post.key);
debug!("Serializing post data for {} to bincode", &post_key);

View File

@ -43,6 +43,7 @@ async fn fetch_name_and_update_db(db: &Database, peer_id: String) {
pub enum Task {
Cancel,
FetchAllPosts(String),
#[allow(dead_code)]
FetchLatestName(String),
}

View File

@ -187,6 +187,7 @@ impl Database {
/// Add a post to the database by inserting an instance of the Post struct
/// into the post tree.
#[allow(dead_code)]
pub fn add_post(&self, public_key: &str, post: Post) -> Result<Option<IVec>> {
let post_key = format!("{}_{}", public_key, post.key);
debug!("Serializing post data for {} to bincode", &post_key);

View File

@ -187,6 +187,7 @@ impl Database {
/// Add a post to the database by inserting an instance of the Post struct
/// into the post tree.
#[allow(dead_code)]
pub fn add_post(&self, public_key: &str, post: Post) -> Result<Option<IVec>> {
let post_key = format!("{}_{}", public_key, post.key);
debug!("Serializing post data for {} to bincode", &post_key);