Skip to content

Commit

Permalink
Update README.md with cargo readme >! README.md.
Browse files Browse the repository at this point in the history
  • Loading branch information
marcianx committed Jan 1, 2025
1 parent 208ec3a commit 430f220
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,9 @@ below.

Since 1.2.0, the minimum supported Rust version is 1.36 due to needing stable access to alloc.

```rust
## #[macro_use]
## extern crate downcast_rs;
## use downcast_rs::{Downcast, DowncastSync};
trait Trait: Downcast {}
impl_downcast!(Trait);

Expand Down Expand Up @@ -64,11 +66,10 @@ impl_downcast!(concrete TraitConcrete1<u32>);

trait TraitConcrete2<T: Copy>: Downcast { type H; }
impl_downcast!(concrete TraitConcrete2<u32> assoc H=f64);
```
## fn main() {}
```rust

## Example without generics

```rust
// Import macro via `macro_use` pre-1.30.
#[macro_use]
extern crate downcast_rs;
Expand Down

0 comments on commit 430f220

Please sign in to comment.