pub fn remove_layer(&mut self, id: LayerId) -> Result<(), DocumentError> {
		let pos = self.position_of_layer(id)?;
		self.layers.remove(pos);
		self.layer_ids.remove(pos);
		Ok(())
	}
/// Remove a layer with a given ID from the folder.
/// This operation will fail if `id` is not present in the folder.
///
/// # Example
/// ```
/// # use graphite_graphene::layers::folder_layer::FolderLayer;
/// let mut folder = FolderLayer::default();
///
/// // Try to remove a layer that does not exist
/// assert!(folder.remove_layer(123).is_err());
///
/// // Add another folder to the folder
/// folder.add_layer(FolderLayer::default().into(), Some(123), -1);
///
/// // Try to remove that folder again
/// assert!(folder.remove_layer(123).is_ok());
/// assert_eq!(folder.layers().len(), 0)
/// ```
Remove a layer with a given ID from the folder.
This operation will fail if `id` is not present in the folder.
Remove a layer with a given ID from the folder . This operation will fail if ` id ` is not present in the folder .
pub fn remove_layer(&mut self, id: LayerId) -> Result<(), DocumentError> {
		let pos = self.position_of_layer(id)?;
		self.layers.remove(pos);
		self.layer_ids.remove(pos);
		Ok(())
	}
pub fn remove_layer ( & mut self , id : LayerId ) -> Result < ( ) , DocumentError > { let pos = self . position_of_layer ( id ) ? ; self . layers . remove ( pos ) ; self . layer_ids . remove ( pos ) ; Ok ( ( ) ) }
Remove a layer with a given ID from the folder.
Remove a layer with a given ID from the folder .
&mut self
id
LayerId
&mut self
id
LayerId
example
None
use graphite_graphene::layers::folder_layer::folderlayer;
let mut folder = FolderLayer::default().

Try to remove a layer that does not exist
assert!(folder.remove_layer(123).is_err()).

Add another folder to the folder
folder.add_layer(FolderLayer::default().into(), Some(123), -1).

Try to remove that folder again
assert!(folder.remove_layer(123).is_ok());
assert_eq!(folder.layers().len(), 0)
```
let mut folder = FolderLayer :: default () . Try to remove a layer that does not exist assert! ( folder . remove_layer ( 123 ) . is_err () ) . Add another folder to the folder folder . add_layer ( FolderLayer :: default () . into () Some ( 123 ) - 1 ) . Try to remove that folder again assert! ( folder . remove_layer ( 123 ) . is_ok () ) ; assert_eq! ( folder . layers () . len () 0 ) ` ` `