forked from pierre/GrammalecteClient
Compare commits
5 Commits
5cce702f03
...
1b31a5d060
Author | SHA1 | Date | |
---|---|---|---|
|
1b31a5d060 | ||
|
738ece6f92 | ||
|
c7b111a53e | ||
|
9a84a9b749 | ||
|
c0854cfb69 |
1453
Cargo.lock
generated
1453
Cargo.lock
generated
File diff suppressed because it is too large
Load Diff
@ -14,18 +14,18 @@ categories = ["text-processing"]
|
|||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
serde_json = "1.0.96"
|
serde_json = "1.0.96"
|
||||||
reqwest = { version = "0.11.18", features = ["json"] }
|
reqwest = { version = "0.12.4", features = ["json"] }
|
||||||
serde = { version = "1.0.163", features = ["derive"] }
|
serde = { version = "1.0.163", features = ["derive"] }
|
||||||
log = "0.4.17"
|
log = "0.4.17"
|
||||||
zip = { version = "0.6.3", optional = true }
|
zip = { version = "2.1.3", optional = true }
|
||||||
mktemp = { version = "0.5.0", optional = true }
|
mktemp = { version = "0.5.0", optional = true }
|
||||||
rand = { version = "0.8.5", optional = true }
|
rand = { version = "0.8.5", optional = true }
|
||||||
port_scanner = {version = "0.1.5", optional = true}
|
port_scanner = { version = "0.1.5", optional = true }
|
||||||
thiserror = "1.0.61"
|
thiserror = "1.0.61"
|
||||||
|
|
||||||
[features]
|
[features]
|
||||||
embedded-server = ["zip", "mktemp", "rand", "port_scanner"]
|
embedded-server = ["zip", "mktemp", "rand", "port_scanner"]
|
||||||
|
|
||||||
[dev-dependencies]
|
[dev-dependencies]
|
||||||
env_logger = "0.10.0"
|
env_logger = "0.11.3"
|
||||||
tokio = { version = "1.28.1", features = ["full"] }
|
tokio = { version = "1.28.1", features = ["full"] }
|
||||||
|
@ -305,6 +305,7 @@ pub struct SuggestResult {
|
|||||||
|
|
||||||
#[derive(Debug, Error)]
|
#[derive(Debug, Error)]
|
||||||
pub enum Error {
|
pub enum Error {
|
||||||
|
#[cfg(feature = "embedded-server")]
|
||||||
#[error("Grammalecte-server failed to start")]
|
#[error("Grammalecte-server failed to start")]
|
||||||
ServerStartFailed(#[from] server::Error),
|
ServerStartFailed(#[from] server::Error),
|
||||||
|
|
||||||
@ -410,7 +411,7 @@ impl GrammalecteClient {
|
|||||||
let mut params = HashMap::new();
|
let mut params = HashMap::new();
|
||||||
params.insert("token", token);
|
params.insert("token", token);
|
||||||
|
|
||||||
Ok(reqwest::Client::new()
|
reqwest::Client::new()
|
||||||
.post(&url)
|
.post(&url)
|
||||||
.form(¶ms)
|
.form(¶ms)
|
||||||
.send()
|
.send()
|
||||||
@ -418,7 +419,7 @@ impl GrammalecteClient {
|
|||||||
.map_err(Error::RequestSendSuggest)?
|
.map_err(Error::RequestSendSuggest)?
|
||||||
.json()
|
.json()
|
||||||
.await
|
.await
|
||||||
.map_err(Error::SuggestDeserialize)?)
|
.map_err(Error::SuggestDeserialize)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user