Merge pull request #244 from alexcrichton/custom-section-new

Add a function to create a `CustomSection`
This commit is contained in:
Sergey Pepyakin 2018-11-19 20:25:09 +01:00 committed by GitHub
commit 00cc0497f1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -287,6 +287,10 @@ pub struct CustomSection {
}
impl CustomSection {
/// Creates a new custom section with the given name and payload
pub fn new(name: String, payload: Vec<u8>) -> CustomSection {
CustomSection { name, payload }
}
/// Name of the custom section
pub fn name(&self) -> &str {