Add publish_post method #3

Merged
notplants merged 4 commits from publish into main 2021-12-26 17:49:50 +00:00
Owner

Just getting warmed up here. This PR adds a wrapper method to publish_post which calls publish.

I also fixed a clippy warning in the init method, which suggests an alternate rust syntax for setting the value of a variable via an if/else clause.

Just getting warmed up here. This PR adds a wrapper method to publish_post which calls publish. I also fixed a clippy warning in the init method, which suggests an alternate rust syntax for setting the value of a variable via an if/else clause.
notplants added 2 commits 2021-12-22 19:50:43 +00:00
notplants requested review from glyph 2021-12-22 19:50:50 +00:00
glyph requested changes 2021-12-23 10:02:10 +00:00
glyph left a comment
Owner

Nice, cool to see this taking shape. I've requested some changes in the review comments.

I also suggest changing the init method name to connect; that should help to clarify that we are connecting to an sbot instance and not start / initialising one.

Nice, cool to see this taking shape. I've requested some changes in the review comments. I also suggest changing the `init` method name to `connect`; that should help to clarify that we are connecting to an sbot instance and not start / initialising one.
src/lib.rs Outdated
@ -24,6 +24,8 @@
//! }
//! ```
extern crate kuska_ssb;
Owner

The need to write extern crate was removed in Rust 2018. Rather write use kuska_ssb;.

The need to write `extern crate` was removed in Rust 2018. Rather write `use kuska_ssb;`.
Author
Owner

oops hmm I'm not sure how or why this got into there, thanks

oops hmm I'm not sure how or why this got into there, thanks
notplants marked this conversation as resolved
@ -43,2 +42,2 @@
if ip_port.is_none() {
address = "127.0.0.1:8008".to_string();
let address = if ip_port.is_none() {
Owner

Ahh this is so much nicer! It always pained me to write let address; but I didn't know an alternative approach.

Ahh this is _so_ much nicer! It always pained me to write `let address;` but I didn't know an alternative approach.
notplants marked this conversation as resolved
src/sbot.rs Outdated
@ -116,0 +116,4 @@
///
/// # Arguments
///
/// * `text` - A &str which represents the text to be published in the post
Owner

Let's replace "A &str..." with "A reference to a string slice...".

Let's replace "A &str..." with "A reference to a string slice...".
notplants marked this conversation as resolved
notplants added 2 commits 2021-12-24 15:34:24 +00:00
Author
Owner

Incorporated the code review suggestions,
and due to accidental git issues, also added the publish_description method to this PR.

but based on your comment on that other PR, it sounds like we could merge this in (since the null fields is not a breaking change, just something that would be nice to fix, and could be fixed in Kuska).

Incorporated the code review suggestions, and due to accidental git issues, also added the publish_description method to this PR. but based on your comment on that other PR, it sounds like we could merge this in (since the null fields is not a breaking change, just something that would be nice to fix, and could be fixed in Kuska).
glyph approved these changes 2021-12-24 15:55:54 +00:00
glyph left a comment
Owner

Noice 🟢

Noice 🟢
notplants merged commit 187d279d7b into main 2021-12-26 17:49:50 +00:00
notplants deleted branch publish 2021-12-26 17:49:50 +00:00
Sign in to join this conversation.
No reviewers
No Milestone
No project
No Assignees
2 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: golgi-ssb/golgi#3
No description provided.