Skip to content

Commit d38d0e9

Browse files
committed
rename norun attribute -> no_run
(cherry picked from commit 967091e)
1 parent f3545b3 commit d38d0e9

File tree

9 files changed

+15
-15
lines changed

9 files changed

+15
-15
lines changed

CONTRIBUTING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ The `quote` and `syn` crates help
6060
- Asynchronous only
6161
- Control API invariants through arguments on API function. For example
6262

63-
```norun
63+
```no_run
6464
client.delete_script(DeleteScriptParts::Id("script_id"))
6565
.send()
6666
.await?;

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ tokio = { version = "*", features = ["full"] }
8585

8686
and to attribute async main function with `#[tokio::main]`
8787

88-
```rust,norun
88+
```rust,no_run
8989
#[tokio::main]
9090
async fn main() -> Result<(), Box<dyn std::error::Error>> {
9191
// your code ...
@@ -95,7 +95,7 @@ async fn main() -> Result<(), Box<dyn std::error::Error>> {
9595

9696
and attribute test functions with `#[tokio::test]`
9797

98-
```rust,norun
98+
```rust,no_run
9999
#[tokio::test]
100100
async fn my_test() -> Result<(), Box<dyn std::error::Error>> {
101101
// your code ...

elasticsearch/docs/Elasticsearch.fn.scroll.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ To initiate a scroll, make search API call with a specified `scroll` timeout,
44
then fetch the next set of hits using the `_scroll_id` returned in
55
the response. Once no more hits are returned, clear the scroll.
66

7-
```rust,norun
7+
```rust,no_run
88
# use elasticsearch::{Elasticsearch, Error, SearchParts, ScrollParts, ClearScrollParts};
99
# use serde_json::{json, Value};
1010
# async fn doc() -> Result<(), Box<dyn std::error::Error>> {

elasticsearch/docs/Indices.fn.create.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
Create an index with a mapping
44

5-
```rust,norun
5+
```rust,no_run
66
# use elasticsearch::{Elasticsearch, Error, indices::IndicesCreateParts};
77
# use serde_json::{json, Value};
88
# async fn doc() -> Result<(), Box<dyn std::error::Error>> {

elasticsearch/docs/Indices.fn.put_mapping.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
Put a mapping into an existing index, assuming the index does not have a mapping,
44
or that any properties specified do not conflict with existing properties
55

6-
```rust,norun
6+
```rust,no_run
77
# use elasticsearch::{Elasticsearch, Error, indices::IndicesPutMappingParts};
88
# use serde_json::{json, Value};
99
# async fn doc() -> Result<(), Box<dyn std::error::Error>> {

elasticsearch/src/cert.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ use std::{
4545
#[cfg_attr(
4646
any(feature = "native-tls", feature = "rustls-tls"),
4747
doc = r##"
48-
```rust,norun
48+
```rust,no_run
4949
# use elasticsearch::{
5050
# auth::Credentials,
5151
# cert::{Certificate,CertificateValidation},
@@ -84,7 +84,7 @@ let _response = client.ping().send().await?;
8484
#[cfg_attr(
8585
feature = "native-tls",
8686
doc = r##"
87-
```rust,norun
87+
```rust,no_run
8888
# use elasticsearch::{
8989
# auth::Credentials,
9090
# cert::{Certificate,CertificateValidation},
@@ -118,7 +118,7 @@ let _response = client.ping().send().await?;
118118
/// No validation is performed on the certificate provided by the server.
119119
/// **Use on production clusters is strongly discouraged**
120120
///
121-
/// ```rust,norun
121+
/// ```rust,no_run
122122
/// # use elasticsearch::{
123123
/// # auth::Credentials,
124124
/// # cert::{Certificate,CertificateValidation},

elasticsearch/src/generated/namespace_clients/indices.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7939,7 +7939,7 @@ impl<'a> Indices<'a> {
79397939
pub fn close<'b>(&'a self, parts: IndicesCloseParts<'b>) -> IndicesClose<'a, 'b, ()> {
79407940
IndicesClose::new(&self.client, parts)
79417941
}
7942-
#[doc = "[Indices Create API](https://www.elastic.co/guide/en/elasticsearch/reference/7.7/indices-create-index.html)\n\nCreates an index with optional settings and mappings.\n\n# Examples\n\nCreate an index with a mapping\n\n```rust,norun\n# use elasticsearch::{Elasticsearch, Error, indices::IndicesCreateParts};\n# use serde_json::{json, Value};\n# async fn doc() -> Result<(), Box<dyn std::error::Error>> {\nlet client = Elasticsearch::default();\nlet response = client\n .indices()\n .create(IndicesCreateParts::Index(\"test_index\"))\n .body(json!({\n \"mappings\" : {\n \"properties\" : {\n \"field1\" : { \"type\" : \"text\" }\n }\n }\n }))\n .send()\n .await?;\n \n# Ok(())\n# }\n```"]
7942+
#[doc = "[Indices Create API](https://www.elastic.co/guide/en/elasticsearch/reference/7.7/indices-create-index.html)\n\nCreates an index with optional settings and mappings.\n\n# Examples\n\nCreate an index with a mapping\n\n```rust,no_run\n# use elasticsearch::{Elasticsearch, Error, indices::IndicesCreateParts};\n# use serde_json::{json, Value};\n# async fn doc() -> Result<(), Box<dyn std::error::Error>> {\nlet client = Elasticsearch::default();\nlet response = client\n .indices()\n .create(IndicesCreateParts::Index(\"test_index\"))\n .body(json!({\n \"mappings\" : {\n \"properties\" : {\n \"field1\" : { \"type\" : \"text\" }\n }\n }\n }))\n .send()\n .await?;\n \n# Ok(())\n# }\n```"]
79437943
pub fn create<'b>(&'a self, parts: IndicesCreateParts<'b>) -> IndicesCreate<'a, 'b, ()> {
79447944
IndicesCreate::new(&self.client, parts)
79457945
}
@@ -8059,7 +8059,7 @@ impl<'a> Indices<'a> {
80598059
pub fn put_alias<'b>(&'a self, parts: IndicesPutAliasParts<'b>) -> IndicesPutAlias<'a, 'b, ()> {
80608060
IndicesPutAlias::new(&self.client, parts)
80618061
}
8062-
#[doc = "[Indices Put Mapping API](https://www.elastic.co/guide/en/elasticsearch/reference/7.7/indices-put-mapping.html)\n\nUpdates the index mappings.\n\n# Examples\n\nPut a mapping into an existing index, assuming the index does not have a mapping, \nor that any properties specified do not conflict with existing properties\n\n```rust,norun\n# use elasticsearch::{Elasticsearch, Error, indices::IndicesPutMappingParts};\n# use serde_json::{json, Value};\n# async fn doc() -> Result<(), Box<dyn std::error::Error>> {\nlet client = Elasticsearch::default();\nlet response = client\n .indices()\n .put_mapping(IndicesPutMappingParts::Index(&[\"test_index\"]))\n .body(json!({\n \"properties\" : {\n \"field1\" : { \"type\" : \"text\" }\n }\n }))\n .send()\n .await?;\n \n# Ok(())\n# }\n```"]
8062+
#[doc = "[Indices Put Mapping API](https://www.elastic.co/guide/en/elasticsearch/reference/7.7/indices-put-mapping.html)\n\nUpdates the index mappings.\n\n# Examples\n\nPut a mapping into an existing index, assuming the index does not have a mapping, \nor that any properties specified do not conflict with existing properties\n\n```rust,no_run\n# use elasticsearch::{Elasticsearch, Error, indices::IndicesPutMappingParts};\n# use serde_json::{json, Value};\n# async fn doc() -> Result<(), Box<dyn std::error::Error>> {\nlet client = Elasticsearch::default();\nlet response = client\n .indices()\n .put_mapping(IndicesPutMappingParts::Index(&[\"test_index\"]))\n .body(json!({\n \"properties\" : {\n \"field1\" : { \"type\" : \"text\" }\n }\n }))\n .send()\n .await?;\n \n# Ok(())\n# }\n```"]
80638063
pub fn put_mapping<'b>(
80648064
&'a self,
80658065
parts: IndicesPutMappingParts<'b>,

elasticsearch/src/generated/root.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8703,7 +8703,7 @@ impl Elasticsearch {
87038703
) -> RenderSearchTemplate<'a, 'b, ()> {
87048704
RenderSearchTemplate::new(&self, parts)
87058705
}
8706-
#[doc = "[Scroll API](https://www.elastic.co/guide/en/elasticsearch/reference/7.7/search-request-body.html#request-body-search-scroll)\n\nAllows to retrieve a large numbers of results from a single search request.\n\n# Examples\n\nTo initiate a scroll, make search API call with a specified `scroll` timeout,\nthen fetch the next set of hits using the `_scroll_id` returned in\nthe response. Once no more hits are returned, clear the scroll.\n\n```rust,norun\n# use elasticsearch::{Elasticsearch, Error, SearchParts, ScrollParts, ClearScrollParts};\n# use serde_json::{json, Value};\n# async fn doc() -> Result<(), Box<dyn std::error::Error>> {\nlet client = Elasticsearch::default();\n\nfn print_hits(hits: &[Value]) {\n for hit in hits {\n println!(\n \"id: '{}', source: '{}', score: '{}'\",\n hit[\"_id\"].as_str().unwrap(),\n hit[\"_source\"],\n hit[\"_score\"].as_f64().unwrap()\n );\n }\n}\n\nlet scroll = \"1m\";\nlet mut response = client\n .search(SearchParts::Index(&[\"tweets\"]))\n .scroll(scroll)\n .body(json!({\n \"query\": {\n \"match\": {\n \"body\": {\n \"query\": \"Elasticsearch rust\",\n \"operator\": \"AND\"\n }\n }\n }\n }))\n .send()\n .await?;\n\nlet mut response_body = response.json::<Value>().await?;\nlet mut scroll_id = response_body[\"_scroll_id\"].as_str().unwrap();\nlet mut hits = response_body[\"hits\"][\"hits\"].as_array().unwrap();\n\nprint_hits(hits);\n\nwhile hits.len() > 0 {\n response = client\n .scroll(ScrollParts::None)\n .body(json!({\n \"scroll\": scroll,\n \"scroll_id\": scroll_id\n }))\n .send()\n .await?;\n\n response_body = response.json::<Value>().await?;\n scroll_id = response_body[\"_scroll_id\"].as_str().unwrap();\n hits = response_body[\"hits\"][\"hits\"].as_array().unwrap();\n print_hits(hits);\n}\n\nresponse = client\n .clear_scroll(ClearScrollParts::None)\n .body(json!({\n \"scroll_id\": scroll_id\n }))\n .send()\n .await?;\n \n# Ok(())\n# }\n```"]
8706+
#[doc = "[Scroll API](https://www.elastic.co/guide/en/elasticsearch/reference/7.7/search-request-body.html#request-body-search-scroll)\n\nAllows to retrieve a large numbers of results from a single search request.\n\n# Examples\n\nTo initiate a scroll, make search API call with a specified `scroll` timeout,\nthen fetch the next set of hits using the `_scroll_id` returned in\nthe response. Once no more hits are returned, clear the scroll.\n\n```rust,no_run\n# use elasticsearch::{Elasticsearch, Error, SearchParts, ScrollParts, ClearScrollParts};\n# use serde_json::{json, Value};\n# async fn doc() -> Result<(), Box<dyn std::error::Error>> {\nlet client = Elasticsearch::default();\n\nfn print_hits(hits: &[Value]) {\n for hit in hits {\n println!(\n \"id: '{}', source: '{}', score: '{}'\",\n hit[\"_id\"].as_str().unwrap(),\n hit[\"_source\"],\n hit[\"_score\"].as_f64().unwrap()\n );\n }\n}\n\nlet scroll = \"1m\";\nlet mut response = client\n .search(SearchParts::Index(&[\"tweets\"]))\n .scroll(scroll)\n .body(json!({\n \"query\": {\n \"match\": {\n \"body\": {\n \"query\": \"Elasticsearch rust\",\n \"operator\": \"AND\"\n }\n }\n }\n }))\n .send()\n .await?;\n\nlet mut response_body = response.json::<Value>().await?;\nlet mut scroll_id = response_body[\"_scroll_id\"].as_str().unwrap();\nlet mut hits = response_body[\"hits\"][\"hits\"].as_array().unwrap();\n\nprint_hits(hits);\n\nwhile hits.len() > 0 {\n response = client\n .scroll(ScrollParts::None)\n .body(json!({\n \"scroll\": scroll,\n \"scroll_id\": scroll_id\n }))\n .send()\n .await?;\n\n response_body = response.json::<Value>().await?;\n scroll_id = response_body[\"_scroll_id\"].as_str().unwrap();\n hits = response_body[\"hits\"][\"hits\"].as_array().unwrap();\n print_hits(hits);\n}\n\nresponse = client\n .clear_scroll(ClearScrollParts::None)\n .body(json!({\n \"scroll_id\": scroll_id\n }))\n .send()\n .await?;\n \n# Ok(())\n# }\n```"]
87078707
pub fn scroll<'a, 'b>(&'a self, parts: ScrollParts<'b>) -> Scroll<'a, 'b, ()> {
87088708
Scroll::new(&self, parts)
87098709
}

elasticsearch/src/lib.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -77,13 +77,13 @@
7777
//! to take a dependency on `tokio` in order to use the client. For example, in Cargo.toml, you may
7878
//! need the following dependency
7979
//!
80-
//! ```toml,norun
80+
//! ```toml,no_run
8181
//! tokio = { version = "*", features = ["full"] }
8282
//! ```
8383
//!
8484
//! and to attribute async main function with `#[tokio::main]`
8585
//!
86-
//! ```rust,norun
86+
//! ```rust,no_run
8787
//! #[tokio::main]
8888
//! async fn main() -> Result<(), Box<dyn std::error::Error>> {
8989
//! // your code ...
@@ -93,7 +93,7 @@
9393
//!
9494
//! and attribute test functions with `#[tokio::test]`
9595
//!
96-
//! ```rust,norun
96+
//! ```rust,no_run
9797
//! #[tokio::test]
9898
//! async fn my_test() -> Result<(), Box<dyn std::error::Error>> {
9999
//! // your code ...

0 commit comments

Comments
 (0)