Skip to content

Commit

Permalink
refactor: change private init method from error to warning (#1043)
Browse files Browse the repository at this point in the history
  • Loading branch information
agostbiro authored Jul 3, 2023
1 parent 159bd9b commit bb8a7f8
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions near-sdk-macros/src/core_impl/info_extractor/visitor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ impl Visitor {
}
}

pub fn visit_private_attr(&mut self, attr: &Attribute) -> syn::Result<()> {
pub fn visit_private_attr(&mut self, _attr: &Attribute) -> syn::Result<()> {
use VisitorKind::*;

match self.kind {
Expand All @@ -95,8 +95,13 @@ impl Visitor {
Ok(())
}
Init => {
let message = format!("{} function can't be private.", self.kind);
Err(Error::new(attr.span(), message))
// TODO: return an error instead in 5.0
// see https://github.com/near/near-sdk-rs/issues/1040
println!("near_bindgen: private init functions will be disallowed in 5.0");
Ok(())

// let message = format!("{} function can't be private.", self.kind);
// Err(Error::new(attr.span(), message))
}
}
}
Expand Down

0 comments on commit bb8a7f8

Please sign in to comment.