forked from rust-lang/book
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Extract where clause example so it'll get rustfmtted in the future
- Loading branch information
1 parent
d6efdcc
commit 92bfbfa
Showing
3 changed files
with
18 additions
and
5 deletions.
There are no files selected for viewing
8 changes: 8 additions & 0 deletions
8
listings/ch10-generic-types-traits-and-lifetimes/no-listing-07-where-clause/Cargo.toml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
[package] | ||
name = "chapter10" | ||
version = "0.1.0" | ||
edition = "2021" | ||
|
||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html | ||
|
||
[dependencies] |
9 changes: 9 additions & 0 deletions
9
listings/ch10-generic-types-traits-and-lifetimes/no-listing-07-where-clause/src/lib.rs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
// ANCHOR: here | ||
fn some_function<T, U>(t: &T, u: &U) -> i32 | ||
where | ||
T: Display + Clone, | ||
U: Clone + Debug, | ||
{ | ||
// ANCHOR_END: here | ||
unimplemented!() | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters