Skip to content

Commit 815bdd5

Browse files
committed
cargo fmt
1 parent b407fd4 commit 815bdd5

File tree

8 files changed

+15
-16
lines changed

8 files changed

+15
-16
lines changed

mdbook-course/src/course.rs

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,8 @@
3535
//! item becomes the first slide in that segment. Any other sub-items of the
3636
//! top-level item are treated as further slides in the same segment.
3737
38-
use crate::frontmatter::{split_frontmatter, Frontmatter};
39-
use crate::markdown::{duration, Table};
38+
use crate::frontmatter::{Frontmatter, split_frontmatter};
39+
use crate::markdown::{Table, duration};
4040
use mdbook::book::{Book, BookItem, Chapter};
4141
use std::fmt::Write;
4242
use std::path::PathBuf;
@@ -318,7 +318,9 @@ impl Session {
318318
}
319319
format!(
320320
"Including {BREAK_DURATION} minute breaks, this session should take about {}. It contains:\n\n{}",
321-
duration(self.minutes()), segments)
321+
duration(self.minutes()),
322+
segments
323+
)
322324
}
323325

324326
/// Return the total duration of this session.
@@ -337,11 +339,7 @@ impl Session {
337339
///
338340
/// This includes breaks between segments.
339341
pub fn target_minutes(&self) -> u64 {
340-
if self.target_minutes > 0 {
341-
self.target_minutes
342-
} else {
343-
self.minutes()
344-
}
342+
if self.target_minutes > 0 { self.target_minutes } else { self.minutes() }
345343
}
346344
}
347345

mdbook-exerciser/src/lib.rs

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

1515
use log::{info, trace};
1616
use pulldown_cmark::{Event, Parser, Tag, TagEnd};
17-
use std::fs::{create_dir_all, File};
17+
use std::fs::{File, create_dir_all};
1818
use std::io::Write;
1919
use std::path::Path;
2020

mdbook-exerciser/src/main.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,9 @@
1414

1515
use anyhow::Context;
1616
use log::trace;
17+
use mdbook::BookItem;
1718
use mdbook::book::Book;
1819
use mdbook::renderer::RenderContext;
19-
use mdbook::BookItem;
2020
use mdbook_exerciser::process;
2121
use std::fs::{create_dir, remove_dir_all};
2222
use std::io::stdin;

src/concurrency/async-exercises/chat-async/src/bin/client.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@
1414

1515
// ANCHOR: solution
1616
// ANCHOR: setup
17-
use futures_util::stream::StreamExt;
1817
use futures_util::SinkExt;
18+
use futures_util::stream::StreamExt;
1919
use http::Uri;
2020
use tokio::io::{AsyncBufReadExt, BufReader};
2121
use tokio_websockets::{ClientBuilder, Message};

src/concurrency/async-exercises/chat-async/src/bin/server.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ use futures_util::stream::StreamExt;
1919
use std::error::Error;
2020
use std::net::SocketAddr;
2121
use tokio::net::{TcpListener, TcpStream};
22-
use tokio::sync::broadcast::{channel, Sender};
22+
use tokio::sync::broadcast::{Sender, channel};
2323
use tokio_websockets::{Message, ServerBuilder, WebSocketStream};
2424
// ANCHOR_END: setup
2525

src/concurrency/sync-exercises/dining-philosophers.rs

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

1515
// ANCHOR: solution
1616
// ANCHOR: Philosopher
17-
use std::sync::{mpsc, Arc, Mutex};
17+
use std::sync::{Arc, Mutex, mpsc};
1818
use std::thread;
1919
use std::time::Duration;
2020

src/concurrency/sync-exercises/link-checker.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,12 @@
1313
// limitations under the License.
1414

1515
// ANCHOR: solution
16-
use std::sync::{mpsc, Arc, Mutex};
16+
use std::sync::{Arc, Mutex, mpsc};
1717
use std::thread;
1818

1919
// ANCHOR: setup
20-
use reqwest::blocking::Client;
2120
use reqwest::Url;
21+
use reqwest::blocking::Client;
2222
use scraper::{Html, Selector};
2323
use thiserror::Error;
2424

third_party/cxx/blobstore/build.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
fn main() {
22
// Find target directory, either from CARGO_TARGET_DIR or in-tree if unset.
3-
let mut src_dir = std::env::var_os("CARGO_TARGET_DIR").unwrap_or("../../../target".into());
3+
let mut src_dir =
4+
std::env::var_os("CARGO_TARGET_DIR").unwrap_or("../../../target".into());
45
src_dir.push("/cxxbridge/demo/src");
56

67
cxx_build::bridge("src/main.rs")

0 commit comments

Comments
 (0)