Skip to content

Commit 0d6f949

Browse files
committed
rename issue to new methods
1 parent ae43533 commit 0d6f949

File tree

4 files changed

+8
-8
lines changed

4 files changed

+8
-8
lines changed

cli/src/cmd.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ fn process(articles_path: PathBuf, dir: Option<PathBuf>) -> anyhow::Result<()> {
121121
let path = dir
122122
.or_else(|| Some(articles_path.parent()?.to_path_buf()))
123123
.ok_or(anyhow::anyhow!("invalid path for creating the contract"))?;
124-
LedgerDir::issue(articles, path)?;
124+
LedgerDir::new(articles, path)?;
125125

126126
Ok(())
127127
}

src/ledger.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,8 @@ pub const LEDGER_VERSION: [u8; 2] = [0x00, 0x01];
4646
pub struct Ledger<S: Stock>(pub(crate) S);
4747

4848
impl<S: Stock> Ledger<S> {
49-
/// Issues a new contract from the provided articles, creating its persistence using given
50-
/// implementation-specific configuration.
49+
/// Instantiates a new contract from the provided articles, creating its persistence with the
50+
/// provided configuration.
5151
///
5252
/// # Panics
5353
///
@@ -56,8 +56,8 @@ impl<S: Stock> Ledger<S> {
5656
/// # Blocking I/O
5757
///
5858
/// This call MAY perform any I/O operations.
59-
pub fn issue(articles: Articles, conf: S::Conf) -> Result<Self, IssueError<S::Error>> {
60-
S::issue(articles, conf).map(Self)
59+
pub fn new(articles: Articles, conf: S::Conf) -> Result<Self, IssueError<S::Error>> {
60+
S::new(articles, conf).map(Self)
6161
}
6262

6363
/// Loads a contract using the provided configuration for persistence.

src/persistance/fs.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ impl Stock for StockFs {
5858
type Conf = PathBuf;
5959
type Error = io::Error;
6060

61-
fn issue(articles: Articles, path: PathBuf) -> Result<Self, IssueError<io::Error>> {
61+
fn new(articles: Articles, path: PathBuf) -> Result<Self, IssueError<io::Error>> {
6262
let state = EffectiveState::from_genesis(&articles)
6363
.map_err(|e| IssueError::Genesis(articles.issue.meta.name.clone(), e))?;
6464

src/stock.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ pub trait Stock {
5151
/// construction.
5252
type Error: StdError;
5353

54-
/// Issues a new contract from the provided articles, creating its persistence using given
54+
/// Creates a new contract from the provided articles, creating its persistence using a given
5555
/// implementation-specific configuration.
5656
///
5757
/// # Panics
@@ -61,7 +61,7 @@ pub trait Stock {
6161
/// # Blocking I/O
6262
///
6363
/// This call MAY perform any I/O operations.
64-
fn issue(articles: Articles, conf: Self::Conf) -> Result<Self, IssueError<Self::Error>>
64+
fn new(articles: Articles, conf: Self::Conf) -> Result<Self, IssueError<Self::Error>>
6565
where Self: Sized;
6666

6767
/// Loads a contract from a persistence using the provided configuration.

0 commit comments

Comments
 (0)