Skip to content

Commit 3d932e2

Browse files
Apply nightly rustfmt formatting to doc comment code examples
1 parent ec7ab37 commit 3d932e2

File tree

6 files changed

+25
-14
lines changed

6 files changed

+25
-14
lines changed

.github/workflows/rust.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -587,7 +587,7 @@ jobs:
587587
uses: ./.github/actions/setup-builder
588588
with:
589589
rust-version: stable
590-
- name: Run cargo fmt check (including doc comments)
590+
- name: Run
591591
run: |
592592
echo '' > datafusion/proto/src/generated/datafusion.rs
593593
ci/scripts/rust_fmt.sh

datafusion/core/src/dataframe/mod.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1380,6 +1380,7 @@ impl DataFrame {
13801380
/// .read_csv("tests/data/example.csv", CsvReadOptions::new())
13811381
/// .await?;
13821382
/// let count = df.count().await?; // 1
1383+
///
13831384
/// # assert_eq!(count, 1);
13841385
/// # Ok(())
13851386
/// # }

datafusion/core/src/execution/context/mod.rs

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -443,7 +443,7 @@ impl SessionContext {
443443
/// # use datafusion::execution::SessionStateBuilder;
444444
/// # use datafusion_optimizer::push_down_filter::PushDownFilter;
445445
/// let my_rule = PushDownFilter {}; // pretend it is a new rule
446-
/// // Create a new builder with a custom optimizer rule
446+
/// // Create a new builder with a custom optimizer rule
447447
/// let context: SessionContext = SessionStateBuilder::new()
448448
/// .with_optimizer_rule(Arc::new(my_rule))
449449
/// .build()
@@ -635,9 +635,10 @@ impl SessionContext {
635635
/// .sql_with_options("CREATE TABLE foo (x INTEGER)", options)
636636
/// .await
637637
/// .unwrap_err();
638-
/// assert!(err
639-
/// .to_string()
640-
/// .starts_with("Error during planning: DDL not supported: CreateMemoryTable"));
638+
/// assert!(
639+
/// err.to_string()
640+
/// .starts_with("Error during planning: DDL not supported: CreateMemoryTable")
641+
/// );
641642
/// # Ok(())
642643
/// # }
643644
/// ```

datafusion/datasource-parquet/src/access_plan.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -42,11 +42,11 @@ use parquet::file::metadata::RowGroupMetaData;
4242
/// // Use parquet reader RowSelector to specify scanning rows 100-200 and 350-400
4343
/// // in a row group that has 1000 rows
4444
/// let row_selection = RowSelection::from(vec![
45-
/// RowSelector::skip(100),
46-
/// RowSelector::select(100),
47-
/// RowSelector::skip(150),
48-
/// RowSelector::select(50),
49-
/// RowSelector::skip(600), // skip last 600 rows
45+
/// RowSelector::skip(100),
46+
/// RowSelector::select(100),
47+
/// RowSelector::skip(150),
48+
/// RowSelector::select(50),
49+
/// RowSelector::skip(600), // skip last 600 rows
5050
/// ]);
5151
/// access_plan.scan_selection(1, row_selection);
5252
/// access_plan.skip(2); // skip row group 2

datafusion/physical-plan/src/sort_pushdown.rs

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -100,15 +100,24 @@ impl<T> SortOrderPushdownResult<T> {
100100
/// # use datafusion_physical_plan::SortOrderPushdownResult;
101101
/// let exact = SortOrderPushdownResult::Exact { inner: 42 };
102102
/// let inexact = exact.into_inexact();
103-
/// assert!(matches!(inexact, SortOrderPushdownResult::Inexact { inner: 42 }));
103+
/// assert!(matches!(
104+
/// inexact,
105+
/// SortOrderPushdownResult::Inexact { inner: 42 }
106+
/// ));
104107
///
105108
/// let already_inexact = SortOrderPushdownResult::Inexact { inner: 42 };
106109
/// let still_inexact = already_inexact.into_inexact();
107-
/// assert!(matches!(still_inexact, SortOrderPushdownResult::Inexact { inner: 42 }));
110+
/// assert!(matches!(
111+
/// still_inexact,
112+
/// SortOrderPushdownResult::Inexact { inner: 42 }
113+
/// ));
108114
///
109115
/// let unsupported = SortOrderPushdownResult::<i32>::Unsupported;
110116
/// let still_unsupported = unsupported.into_inexact();
111-
/// assert!(matches!(still_unsupported, SortOrderPushdownResult::Unsupported));
117+
/// assert!(matches!(
118+
/// still_unsupported,
119+
/// SortOrderPushdownResult::Unsupported
120+
/// ));
112121
/// ```
113122
pub fn into_inexact(self) -> Self {
114123
match self {

datafusion/proto/src/bytes/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ mod registry;
4747
/// bytes.
4848
///
4949
/// ```
50-
/// use datafusion_expr::{col, lit, Expr};
50+
/// use datafusion_expr::{Expr, col, lit};
5151
/// use datafusion_proto::bytes::Serializeable;
5252
///
5353
/// // Create a new `Expr` a < 32

0 commit comments

Comments
 (0)