Skip to content

Commit

Permalink
rename method
Browse files Browse the repository at this point in the history
  • Loading branch information
yggverse committed Oct 25, 2024
1 parent bfc5260 commit 16af949
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ cargo add ggemini
## `client`


#### `client::simple_socket_request_async`
#### `client::single_socket_request_async`

High-level API to make async socket request and auto-close connection on complete.

Expand All @@ -29,7 +29,7 @@ use glib::{Uri, UriFlags};
// Parse URL string to valid URI
match Uri::parse("gemini://geminiprotocol.net/", UriFlags::NONE) {
// Begin async request
Ok(uri) => ggemini::client::simple_socket_request_async(uri, |result| match result {
Ok(uri) => ggemini::client::single_socket_request_async(uri, |result| match result {
// Process response
Ok(response) => {
// Expect success status
Expand Down
2 changes: 1 addition & 1 deletion src/client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ use glib::Uri;
/// 3. read response
/// 4. close connection
/// 5. return `Result<Response, Error>` to `callback` function
pub fn simple_socket_request_async(
pub fn single_socket_request_async(
uri: Uri,
callback: impl FnOnce(Result<Response, Error>) + 'static,
) {
Expand Down
4 changes: 2 additions & 2 deletions tests/client.rs
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
use glib::{Uri, UriFlags};

#[test]
fn simple_socket_request_async() {
fn single_socket_request_async() {
// Parse URI
match Uri::parse("gemini://geminiprotocol.net/", UriFlags::NONE) {
// Begin async request
Ok(uri) => ggemini::client::simple_socket_request_async(uri, |result| match result {
Ok(uri) => ggemini::client::single_socket_request_async(uri, |result| match result {
// Process response
Ok(response) => {
// Expect success status
Expand Down

0 comments on commit 16af949

Please sign in to comment.