diff options
author | HampusM <hampus@hampusmat.com> | 2022-08-20 17:10:08 +0200 |
---|---|---|
committer | HampusM <hampus@hampusmat.com> | 2022-08-21 18:17:50 +0200 |
commit | ade21185976ea2324d313a5c28a88cc0492f2934 (patch) | |
tree | f217d55ad324160d8a9a099c562c8bc6cbb60c1f /examples/with-3rd-party/third-party-lib | |
parent | b31422d48a600ccccb682567f5eb11fc0bca547c (diff) |
docs: add a example that uses a 3rd party library
Diffstat (limited to 'examples/with-3rd-party/third-party-lib')
-rw-r--r-- | examples/with-3rd-party/third-party-lib/Cargo.toml | 6 | ||||
-rw-r--r-- | examples/with-3rd-party/third-party-lib/src/lib.rs | 23 |
2 files changed, 29 insertions, 0 deletions
diff --git a/examples/with-3rd-party/third-party-lib/Cargo.toml b/examples/with-3rd-party/third-party-lib/Cargo.toml new file mode 100644 index 0000000..37668c4 --- /dev/null +++ b/examples/with-3rd-party/third-party-lib/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "third-party-lib" +version = "0.1.0" +edition = "2021" + +[dependencies] diff --git a/examples/with-3rd-party/third-party-lib/src/lib.rs b/examples/with-3rd-party/third-party-lib/src/lib.rs new file mode 100644 index 0000000..f3b3ed3 --- /dev/null +++ b/examples/with-3rd-party/third-party-lib/src/lib.rs @@ -0,0 +1,23 @@ +pub trait IShuriken +{ + fn throw(&self); +} + +pub struct Shuriken {} + +impl Shuriken +{ + #[allow(clippy::new_without_default)] + pub fn new() -> Self + { + Self {} + } +} + +impl IShuriken for Shuriken +{ + fn throw(&self) + { + println!("Threw shuriken!"); + } +} |