mirror of
https://github.com/YGGverse/ggemini.git
synced 2026-03-31 17:15:31 +00:00
use FnOnce for callback function
This commit is contained in:
parent
c67593e5fd
commit
61fbab6dae
2 changed files with 5 additions and 5 deletions
|
|
@ -60,7 +60,7 @@ impl Client {
|
|||
priority: Priority,
|
||||
cancellable: Cancellable,
|
||||
certificate: Option<TlsCertificate>,
|
||||
callback: impl Fn(Result<Response, Error>) + 'static,
|
||||
callback: impl FnOnce(Result<Response, Error>) + 'static,
|
||||
) {
|
||||
// Begin new connection
|
||||
// * [NetworkAddress](https://docs.gtk.org/gio/class.NetworkAddress.html) required for valid
|
||||
|
|
|
|||
|
|
@ -56,7 +56,7 @@ impl Connection {
|
|||
request: Request,
|
||||
priority: Priority,
|
||||
cancellable: Cancellable,
|
||||
callback: impl Fn(Result<Response, Error>) + 'static,
|
||||
callback: impl FnOnce(Result<Response, Error>) + 'static,
|
||||
) {
|
||||
match request {
|
||||
Request::Gemini(request) => {
|
||||
|
|
@ -77,7 +77,7 @@ impl Connection {
|
|||
request: Gemini,
|
||||
priority: Priority,
|
||||
cancellable: Cancellable,
|
||||
callback: impl Fn(Result<Response, Error>) + 'static,
|
||||
callback: impl FnOnce(Result<Response, Error>) + 'static,
|
||||
) {
|
||||
self.bytes_request_async(&request.to_bytes(), priority, cancellable, callback);
|
||||
}
|
||||
|
|
@ -91,7 +91,7 @@ impl Connection {
|
|||
request: Titan,
|
||||
priority: Priority,
|
||||
cancellable: Cancellable,
|
||||
callback: impl Fn(Result<Response, Error>) + 'static,
|
||||
callback: impl FnOnce(Result<Response, Error>) + 'static,
|
||||
) {
|
||||
self.bytes_request_async(&request.to_bytes(), priority, cancellable, callback);
|
||||
}
|
||||
|
|
@ -107,7 +107,7 @@ impl Connection {
|
|||
request: &Bytes,
|
||||
priority: Priority,
|
||||
cancellable: Cancellable,
|
||||
callback: impl Fn(Result<Response, Error>) + 'static,
|
||||
callback: impl FnOnce(Result<Response, Error>) + 'static,
|
||||
) {
|
||||
self.stream().output_stream().write_bytes_async(
|
||||
request,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue