From 74fe0514b60dc13c59721258f22a0abd12d98745 Mon Sep 17 00:00:00 2001 From: Alex Crichton Date: Mon, 19 Nov 2018 10:37:51 -0800 Subject: [PATCH] Add a function to create a `CustomSection` --- src/elements/section.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/elements/section.rs b/src/elements/section.rs index 285a3c6..9bc6988 100644 --- a/src/elements/section.rs +++ b/src/elements/section.rs @@ -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) -> CustomSection { + CustomSection { name, payload } + } /// Name of the custom section pub fn name(&self) -> &str {