Skip to content

Commit

Permalink
format_code_in_doc_comments = true
Browse files Browse the repository at this point in the history
Reviewed By: zertosh

Differential Revision: D52641269

fbshipit-source-id: e86b0fc0d695caee69ad01e793d3f34a63830695
  • Loading branch information
stepancheg authored and facebook-github-bot committed Jan 10, 2024
1 parent 19c66f7 commit 13304c2
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 9 deletions.
22 changes: 14 additions & 8 deletions compiler/crates/intern/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,8 @@
//!
//! Simply import `intern::string` and go to town:
//! ```
//! use intern::string::{self, StringId};
//! use intern::string::StringId;
//! use intern::string;
//!
//! let a: StringId = string::intern("a");
//! let b = string::intern("b");
Expand All @@ -62,27 +63,32 @@
//! static reference to the interned object referred to by `my_id`.
//! ```
//! # #[macro_use]
//! use intern::{InternId, InternSerdes, intern_struct};
//! use serde_derive::{Deserialize, Serialize};
//! use intern::intern_struct;
//! use intern::InternId;
//! use intern::InternSerdes;
//! use serde_derive::Deserialize;
//! use serde_derive::Serialize;
//!
//! #[derive(Debug, PartialEq, Eq, Hash, Deserialize, Serialize)]
//! struct MyType{ v: i64 }
//! struct MyType {
//! v: i64,
//! }
//!
//! intern_struct! {
//! struct MyId = Intern<MyType> { serdes("InternSerdes<MyId>"); }
//! }
//!
//! # fn main() {
//! let m1 = MyType{ v: 1 };
//! let m2 = MyType{ v: 1 };
//! let m3 = MyType{ v: -57 };
//! let m1 = MyType { v: 1 };
//! let m2 = MyType { v: 1 };
//! let m3 = MyType { v: -57 };
//! let i1 = MyId::intern(m1);
//! let i2 = MyId::intern(m2);
//! let i3 = MyId::intern(m3);
//! assert_eq!(i1, i2);
//! assert_eq!(i1.get().v, 1);
//! assert!(i1 != i3);
//! assert_eq!(i3.v, -57); // Uses Deref
//! assert_eq!(i3.v, -57); // Uses Deref
//! # }
//! ```
//!
Expand Down
1 change: 0 additions & 1 deletion compiler/crates/interner/src/macros.rs
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ macro_rules! intern {
/// let user: User = User { name };
/// let user_key: UserKey = user.intern();
/// ```
///
#[macro_export]
macro_rules! make_intern {
($name:ident as $alias:ident) => {
Expand Down

0 comments on commit 13304c2

Please sign in to comment.