chore: fix some comments (#2712)
Signed-off-by: renshuncui <renshun@111.com>
This commit is contained in:
parent
8c9dfd9c9d
commit
b9c620d4cd
|
@ -112,7 +112,7 @@ pub fn request_animation_frame(cb: impl FnOnce() + 'static) {
|
||||||
// Closure::once_into_js only frees the callback when it's actually
|
// Closure::once_into_js only frees the callback when it's actually
|
||||||
// called, so this instead uses into_js_value, which can be freed by
|
// called, so this instead uses into_js_value, which can be freed by
|
||||||
// the host JS engine's GC if it supports weak references (which all
|
// the host JS engine's GC if it supports weak references (which all
|
||||||
// modern brower engines do). The way this works is that the provided
|
// modern browser engines do). The way this works is that the provided
|
||||||
// callback's captured data is dropped immediately after being called,
|
// callback's captured data is dropped immediately after being called,
|
||||||
// as before, but it leaves behind a small stub closure rust-side that
|
// as before, but it leaves behind a small stub closure rust-side that
|
||||||
// will be freed "eventually" by the JS GC. If the function is never
|
// will be freed "eventually" by the JS GC. If the function is never
|
||||||
|
|
|
@ -108,7 +108,7 @@
|
||||||
////! HTML forms don’t support `PUT` or `DELETE`, and they don’t support sending JSON. This means that if you use anything
|
////! HTML forms don’t support `PUT` or `DELETE`, and they don’t support sending JSON. This means that if you use anything
|
||||||
////! but a `GET` or `POST` request with URL-encoded data, it can only work once WASM has loaded.
|
////! but a `GET` or `POST` request with URL-encoded data, it can only work once WASM has loaded.
|
||||||
////!
|
////!
|
||||||
////! The CBOR encoding is suported for historical reasons; an earlier version of server functions used a URL encoding that
|
////! The CBOR encoding is supported for historical reasons; an earlier version of server functions used a URL encoding that
|
||||||
////! didn’t support nested objects like structs or vectors as server function arguments, which CBOR did. But note that the
|
////! didn’t support nested objects like structs or vectors as server function arguments, which CBOR did. But note that the
|
||||||
////! CBOR forms encounter the same issue as `PUT`, `DELETE`, or JSON: they do not degrade gracefully if the WASM version of
|
////! CBOR forms encounter the same issue as `PUT`, `DELETE`, or JSON: they do not degrade gracefully if the WASM version of
|
||||||
////! your app is not available.
|
////! your app is not available.
|
||||||
|
|
|
@ -37,7 +37,7 @@ pub fn make_openapi_call_via_gpt(message:String) -> ChatCompletionParameters {
|
||||||
// This name will be given to the OpenAI API as part of our functions
|
// This name will be given to the OpenAI API as part of our functions
|
||||||
let name = operation.operation_id.clone().expect("Each operation to have an operation id");
|
let name = operation.operation_id.clone().expect("Each operation to have an operation id");
|
||||||
|
|
||||||
// we'll use the descrition
|
// we'll use the description
|
||||||
let desc = operation.description.clone().expect("Each operation to have a description, this is how GPT knows what the functiond does and it is helpful for calling it.");
|
let desc = operation.description.clone().expect("Each operation to have a description, this is how GPT knows what the functiond does and it is helpful for calling it.");
|
||||||
let mut required_list = vec![];
|
let mut required_list = vec![];
|
||||||
let mut properties = serde_json::Map::new();
|
let mut properties = serde_json::Map::new();
|
||||||
|
|
|
@ -93,7 +93,7 @@ pub fn kratos_html(node: UiNode, body: RwSignal<HashMap<String, String>>) -> imp
|
||||||
body.update(|map| {
|
body.update(|map| {
|
||||||
_ = map.insert(name.clone(), value.clone());
|
_ = map.insert(name.clone(), value.clone());
|
||||||
});
|
});
|
||||||
// this expects the identifer to be an email, but it could be telelphone etc so code is extra fragile
|
// this expects the identifier to be an email, but it could be telephone etc so code is extra fragile
|
||||||
view! {<input type="hidden" value=value name=name /> }.into_view()
|
view! {<input type="hidden" value=value name=name /> }.into_view()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -27,7 +27,7 @@ pub static LOGOUT_BUTTON_ID: &'static str = "logout_button_id";
|
||||||
pub static LOGIN_BUTTON_ID: &'static str = "login_button_id";
|
pub static LOGIN_BUTTON_ID: &'static str = "login_button_id";
|
||||||
/// This function is for use in kratos_html, it takes the name of the input node and it
|
/// This function is for use in kratos_html, it takes the name of the input node and it
|
||||||
/// matches it according to what we've specified in the kratos schema file. If we change the schema.
|
/// matches it according to what we've specified in the kratos schema file. If we change the schema.
|
||||||
/// I.e use a phone instead of an email, the identifer id will change and break tests that expect an email.
|
/// I.e use a phone instead of an email, the identifier id will change and break tests that expect an email.
|
||||||
/// i.e use oidc instead of password, as auth method... that will break tests too.
|
/// i.e use oidc instead of password, as auth method... that will break tests too.
|
||||||
/// Which is good.
|
/// Which is good.
|
||||||
pub fn match_name_to_id(name: String) -> &'static str {
|
pub fn match_name_to_id(name: String) -> &'static str {
|
||||||
|
|
|
@ -5,7 +5,7 @@ First
|
||||||
cargo new leptos_tauri_from_scratch
|
cargo new leptos_tauri_from_scratch
|
||||||
```
|
```
|
||||||
|
|
||||||
Then, make our two seperate project folders. We need one for our actual app, 'src-orig' and the other is required when using `cargo tauri`
|
Then, make our two separate project folders. We need one for our actual app, 'src-orig' and the other is required when using `cargo tauri`
|
||||||
```sh
|
```sh
|
||||||
mkdir src-orig && mkdir src-tauri
|
mkdir src-orig && mkdir src-tauri
|
||||||
```
|
```
|
||||||
|
|
|
@ -14,7 +14,7 @@ server_fn_macro_default = { workspace = true }
|
||||||
# used for hashing paths in #[server] macro
|
# used for hashing paths in #[server] macro
|
||||||
const_format = "0.2"
|
const_format = "0.2"
|
||||||
xxhash-rust = { version = "0.8", features = ["const_xxh64"] }
|
xxhash-rust = { version = "0.8", features = ["const_xxh64"] }
|
||||||
# used across multiple featurs
|
# used across multiple features
|
||||||
serde = { version = "1", features = ["derive"] }
|
serde = { version = "1", features = ["derive"] }
|
||||||
send_wrapper = { version = "0.6", features = ["futures"], optional = true }
|
send_wrapper = { version = "0.6", features = ["futures"], optional = true }
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue